.afc-host-card {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.afc-host-card > .card-body {
    padding: 0;
}

.afc-tool {
    --afc-primary: #1267d8;
    --afc-primary-dark: #0b4e9d;
    --afc-teal: #0f8f82;
    --afc-teal-dark: #0b756b;
    --afc-amber: #c77700;
    --afc-red: #d92d20;
    --afc-green: #138a5b;
    --afc-ink: #172033;
    --afc-muted: #667085;
    --afc-line: #d8e2ee;
    --afc-soft: #f5f8fc;
    --afc-soft-blue: #eef6ff;
    --afc-white: #fff;
    --afc-radius: 8px;
    --afc-shadow: 0 10px 24px rgba(22, 48, 80, .07);
    width: 100%;
    color: var(--afc-ink);
    background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
}

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

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

.afc-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid #cddbeb;
    background: #f1f7ff;
    color: #1e4a78;
    font-size: 13px;
    line-height: 1.65;
}

.afc-alert i {
    color: var(--afc-primary);
    font-size: 18px;
    margin-top: 1px;
}

.afc-alert strong {
    display: block;
    color: #123b6e;
}

.afc-alert span {
    display: block;
}

.afc-engine-state {
    align-self: center;
    border: 1px solid #b8d6ff;
    border-radius: 999px;
    background: #fff;
    color: var(--afc-primary-dark);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.afc-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 14px 18px;
    background: #edf3f8;
    border-bottom: 1px solid var(--afc-line);
}

.afc-tab {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid #bfd0e5;
    border-radius: 8px;
    background: #fff;
    color: #0b4e9d;
    text-align: left;
    cursor: pointer;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .2s, color .2s;
}

.afc-tab:hover {
    border-color: var(--afc-teal);
    color: var(--afc-teal);
    transform: translateY(-1px);
}

.afc-tab.active {
    background: linear-gradient(135deg, var(--afc-primary), var(--afc-primary-dark));
    border-color: var(--afc-primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(18, 103, 216, .18);
}

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

.afc-tab.active .afc-tab-index {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.afc-tab b,
.afc-tab small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afc-tab b {
    font-size: 15px;
    font-weight: 900;
    color: inherit;
}

.afc-tab small {
    margin-top: 2px;
    font-size: 12px;
    color: currentColor;
    opacity: .78;
}

.afc-tab.is-done:not(.active) {
    border-color: rgba(15, 143, 130, .4);
    color: var(--afc-teal);
}

.afc-body {
    padding: 18px;
}

.afc-panel-tab {
    display: none;
}

.afc-panel-tab.active {
    display: block;
}

.afc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(320px, .98fr);
    gap: 16px;
    align-items: start;
}

.afc-panel {
    border: 1px solid var(--afc-line);
    border-radius: var(--afc-radius);
    background: #fff;
    box-shadow: var(--afc-shadow);
    overflow: hidden;
}

.afc-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--afc-line);
    background: #f8fbff;
}

.afc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #16233a;
    font-size: 15px;
    font-weight: 900;
}

.afc-title i {
    color: var(--afc-primary);
}

.afc-note {
    margin: 3px 0 0;
    color: var(--afc-muted);
    font-size: 12px;
    line-height: 1.55;
}

.afc-panel-body {
    padding: 16px;
}

.afc-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 224px;
    padding: 24px;
    border: 2px dashed #9ec8ff;
    border-radius: var(--afc-radius);
    background: linear-gradient(135deg, #f7fbff, #f1f8f6);
    cursor: pointer;
    text-align: center;
    transition: border-color .2s, background .2s, transform .2s;
}

.afc-drop:hover,
.afc-drop.dragging {
    border-color: var(--afc-teal);
    background: #f1fbf9;
    transform: translateY(-1px);
}

.afc-drop input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.afc-drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: #dcecff;
    color: var(--afc-primary);
    font-size: 28px;
}

.afc-drop-main {
    display: block;
    font-size: 16px;
    font-weight: 900;
    color: #16233a;
}

.afc-drop-sub {
    display: block;
    margin-top: 6px;
    color: var(--afc-muted);
    font-size: 12px;
    line-height: 1.5;
}

.afc-actions,
.afc-actions-inline,
.afc-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.afc-actions,
.afc-quick-grid,
.afc-form-grid {
    margin-top: 14px;
}

.afc-nav {
    justify-content: space-between;
    margin-top: 16px;
}

.afc-inline-tip {
    color: var(--afc-muted);
    font-size: 13px;
}

.afc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .2s, color .2s;
}

.afc-btn:hover {
    transform: translateY(-1px);
}

.afc-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.afc-btn-primary {
    background: linear-gradient(135deg, var(--afc-primary), var(--afc-primary-dark));
    color: #fff;
    box-shadow: 0 10px 20px rgba(18, 103, 216, .2);
}

.afc-btn-primary:hover,
.afc-btn-success:hover {
    color: #fff;
}

.afc-btn-success {
    background: linear-gradient(135deg, var(--afc-teal), var(--afc-teal-dark));
    color: #fff;
    box-shadow: 0 10px 20px rgba(15, 143, 130, .17);
}

.afc-btn-secondary {
    background: #fff;
    color: #134e8a;
    border-color: #b8d6ff;
}

.afc-btn-secondary:hover {
    background: #f3f8ff;
    color: #0b4e9d;
}

.afc-btn-warning {
    background: #fff8eb;
    color: #8a5300;
    border-color: #f0c476;
}

.afc-btn-danger {
    background: #fff5f4;
    color: #9b251a;
    border-color: #f5b7b1;
}

.afc-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.afc-stat {
    padding: 12px;
    border: 1px solid var(--afc-line);
    border-radius: var(--afc-radius);
    background: var(--afc-soft);
    text-align: center;
    min-width: 0;
}

.afc-stat-value {
    color: #0d3f84;
    font-size: 18px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afc-stat-label {
    margin-top: 2px;
    color: var(--afc-muted);
    font-size: 12px;
}

.afc-file-list {
    display: grid;
    gap: 10px;
    max-height: 560px;
    overflow: auto;
    padding-right: 2px;
}

.afc-file-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--afc-line);
    border-radius: var(--afc-radius);
    background: #fff;
}

.afc-file-name {
    font-size: 13px;
    font-weight: 900;
    color: #18202f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afc-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    color: var(--afc-muted);
    font-size: 12px;
}

.afc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef4fb;
    color: #475467;
    font-size: 12px;
}

.afc-file-item audio {
    width: 180px;
    height: 38px;
}

.afc-empty,
.afc-more-note {
    padding: 13px;
    border: 1px dashed var(--afc-line);
    border-radius: var(--afc-radius);
    background: var(--afc-soft);
    color: var(--afc-muted);
    font-size: 13px;
    text-align: center;
    line-height: 1.55;
}

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

.afc-form-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.afc-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.afc-field label {
    color: #26364f;
    font-size: 13px;
    font-weight: 900;
}

.afc-field input[type="number"],
.afc-field input[type="text"],
.afc-field select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd7e6;
    border-radius: 7px;
    background: #fff;
    color: #101828;
    padding: 8px 11px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.afc-field input:focus,
.afc-field select:focus {
    border-color: var(--afc-primary);
    box-shadow: 0 0 0 3px rgba(18, 103, 216, .13);
}

.afc-wide {
    grid-column: 1 / -1;
}

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

.afc-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--afc-line);
    border-radius: var(--afc-radius);
    background: #fff;
    color: #344054;
    font-size: 13px;
    line-height: 1.45;
    cursor: pointer;
}

.afc-check input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--afc-primary);
}

.afc-check b,
.afc-check small {
    display: block;
}

.afc-check small {
    margin-top: 2px;
    color: var(--afc-muted);
    font-size: 12px;
}

.afc-range-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
}

.afc-range-wrap input {
    flex: 1;
    accent-color: var(--afc-primary);
}

.afc-range-value {
    min-width: 58px;
    padding: 6px 8px;
    border-radius: 999px;
    background: #e8f2ff;
    color: #0b4e9d;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
}

.afc-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.afc-quick {
    padding: 12px 10px;
    border: 1px solid var(--afc-line);
    border-radius: var(--afc-radius);
    background: #fff;
    color: #1d3557;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.afc-quick:hover {
    border-color: var(--afc-primary);
    box-shadow: 0 8px 18px rgba(18, 103, 216, .12);
    transform: translateY(-1px);
}

.afc-quick strong,
.afc-quick span {
    display: block;
}

.afc-quick strong {
    color: #16233a;
    font-size: 13px;
}

.afc-quick span {
    margin-top: 4px;
    color: var(--afc-muted);
    font-size: 12px;
}

.afc-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.afc-summary-item {
    padding: 12px;
    border: 1px solid var(--afc-line);
    border-radius: var(--afc-radius);
    background: var(--afc-soft);
}

.afc-summary-item span,
.afc-summary-item b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afc-summary-item span {
    color: var(--afc-muted);
    font-size: 12px;
}

.afc-summary-item b {
    margin-top: 3px;
    color: #16233a;
    font-size: 14px;
    font-weight: 900;
}

.afc-progress-wrap {
    display: none;
    margin-top: 12px;
}

.afc-progress-track {
    height: 22px;
    border-radius: 999px;
    background: #edf2f8;
    overflow: hidden;
}

.afc-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--afc-primary), var(--afc-teal));
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    transition: width .2s;
}

.afc-status {
    min-height: 26px;
    margin-top: 10px;
    color: var(--afc-muted);
    font-size: 13px;
    text-align: center;
    line-height: 1.55;
}

.afc-status.success {
    color: var(--afc-green);
}

.afc-status.error {
    color: var(--afc-red);
}

.afc-result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.afc-result-card {
    border: 1px solid var(--afc-line);
    border-radius: var(--afc-radius);
    background: #fff;
    overflow: hidden;
}

.afc-result-audio {
    padding: 12px;
    background: linear-gradient(135deg, #f8fbff, #eef6f5);
    border-bottom: 1px solid var(--afc-line);
}

.afc-result-audio audio {
    display: block;
    width: 100%;
}

.afc-result-body {
    padding: 10px;
}

.afc-result-name {
    color: #1f2a44;
    font-size: 12px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afc-result-meta {
    margin-top: 5px;
    margin-bottom: 8px;
    color: var(--afc-muted);
    font-size: 12px;
    line-height: 1.45;
}

.afc-error-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.afc-error-item {
    border: 1px solid #f4b5ad;
    border-radius: var(--afc-radius);
    background: #fff5f4;
    color: #912018;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
}

.afc-hidden {
    display: none !important;
}

@media (max-width: 1080px) {
    .afc-layout,
    .afc-form-grid,
    .afc-form-grid-two {
        grid-template-columns: 1fr;
    }

    .afc-quick-grid,
    .afc-summary,
    .afc-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .afc-alert {
        grid-template-columns: auto 1fr;
    }

    .afc-engine-state {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .afc-tabs,
    .afc-stat-grid,
    .afc-check-grid,
    .afc-quick-grid,
    .afc-summary,
    .afc-result-grid {
        grid-template-columns: 1fr;
    }

    .afc-file-item {
        grid-template-columns: 1fr;
    }

    .afc-file-item audio {
        width: 100%;
    }

    .afc-panel-head,
    .afc-nav {
        display: grid;
    }

    .afc-body,
    .afc-panel-body {
        padding: 14px;
    }
}
