.afce-host-card {
    border: 0;
    box-shadow: none;
    background: transparent;
}

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

.afce-tool {
    --afce-ink: #142033;
    --afce-muted: #64748b;
    --afce-line: #d8e2ee;
    --afce-soft: #f6f9fc;
    --afce-soft-2: #ecfeff;
    --afce-card: #ffffff;
    --afce-primary: #0f6fb5;
    --afce-primary-dark: #0a4f82;
    --afce-teal: #0d9488;
    --afce-teal-dark: #0f766e;
    --afce-amber: #b7791f;
    --afce-danger: #dc2626;
    --afce-success: #15803d;
    --afce-shadow: 0 16px 36px rgba(28, 45, 73, .09);
    color: var(--afce-ink);
    width: 100%;
}

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

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

.afce-tool input,
.afce-tool select,
.afce-tool button {
    letter-spacing: 0;
}

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

.afce-notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid #b9d9ee;
    background:
        linear-gradient(135deg, rgba(15, 111, 181, .08), rgba(13, 148, 136, .08)),
        #ffffff;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.afce-notice-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f4fb;
    color: var(--afce-primary-dark);
    font-size: 18px;
}

.afce-notice strong {
    display: block;
    margin-bottom: 3px;
    color: #102a43;
    font-size: 15px;
}

.afce-notice span {
    color: var(--afce-muted);
    line-height: 1.55;
    font-size: 13px;
}

.afce-engine {
    justify-self: end;
    border: 1px solid #b9cde3;
    background: #f8fbfd;
    color: #1f3b57 !important;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px !important;
    font-weight: 800;
    white-space: nowrap;
}

.afce-engine.ready {
    border-color: #9bd7ca;
    background: #ecfdf5;
    color: var(--afce-teal-dark) !important;
}

.afce-engine.busy {
    border-color: #f4cf8f;
    background: #fff7ed;
    color: var(--afce-amber) !important;
}

.afce-engine.error {
    border-color: #f2b8b8;
    background: #fff5f5;
    color: var(--afce-danger) !important;
}

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

.afce-tab {
    min-height: 66px;
    border: 1px solid var(--afce-line);
    background: #ffffff;
    color: #16324f;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

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

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

.afce-tab.done {
    border-color: rgba(13, 148, 136, .38);
}

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

.afce-tab.active .afce-tab-index {
    color: #ffffff;
    background: var(--afce-primary);
}

.afce-tab.done .afce-tab-index {
    color: #ffffff;
    background: var(--afce-teal);
}

.afce-tab b {
    display: block;
    color: #102a43;
    font-size: 15px;
    line-height: 1.25;
}

.afce-tab small {
    display: block;
    margin-top: 3px;
    color: #47627d;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
}

.afce-body {
    display: block;
}

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

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

.afce-layout {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr);
    gap: 14px;
    align-items: start;
}

.afce-layout-wide {
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
}

.afce-panel {
    border: 1px solid var(--afce-line);
    border-radius: 8px;
    background: var(--afce-card);
    box-shadow: var(--afce-shadow);
    overflow: hidden;
}

.afce-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid #ebf0f6;
    background: #f8fafc;
}

.afce-title {
    margin: 0 0 4px;
    color: #102a43;
    font-weight: 900;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

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

.afce-note {
    margin: 0;
    color: var(--afce-muted);
    font-size: 13px;
    line-height: 1.6;
}

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

.afce-drop {
    min-height: 210px;
    border: 2px dashed #b6c7da;
    border-radius: 8px;
    background: linear-gradient(180deg, #fbfdff, #f2f8fb);
    display: grid;
    place-items: center;
    gap: 8px;
    text-align: center;
    padding: 24px;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.afce-drop:hover,
.afce-drop.dragover {
    border-color: var(--afce-primary);
    background: #eef7fc;
    transform: translateY(-1px);
}

.afce-drop input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.afce-drop-icon {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--afce-primary);
    font-size: 25px;
}

.afce-drop-main {
    display: block;
    color: #16324f;
    font-size: 17px;
    font-weight: 900;
}

.afce-drop-sub {
    display: block;
    color: var(--afce-muted);
    font-size: 13px;
    line-height: 1.6;
}

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

.afce-actions {
    margin-top: 14px;
}

.afce-nav {
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #edf2f7;
}

.afce-inline-tip {
    color: var(--afce-muted);
    font-size: 13px;
    line-height: 1.5;
}

.afce-btn {
    min-height: 40px;
    border: 1px solid #cbd8e6;
    background: #ffffff;
    color: #24364b;
    border-radius: 7px;
    padding: 9px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.afce-btn:hover:not(:disabled) {
    border-color: var(--afce-primary);
    color: var(--afce-primary-dark);
    transform: translateY(-1px);
}

.afce-btn:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.afce-btn-primary {
    border-color: var(--afce-primary);
    background: var(--afce-primary);
    color: #ffffff;
}

.afce-btn-primary:hover:not(:disabled) {
    background: var(--afce-primary-dark);
    color: #ffffff;
}

.afce-btn-secondary {
    background: #f8fafc;
}

.afce-btn-success {
    border-color: var(--afce-teal);
    background: var(--afce-teal);
    color: #ffffff;
}

.afce-btn-success:hover:not(:disabled) {
    background: var(--afce-teal-dark);
    color: #ffffff;
}

.afce-btn-danger {
    border-color: #efb7b7;
    color: var(--afce-danger);
    background: #fffafa;
}

.afce-btn-warning {
    border-color: #f0c981;
    color: #8a5a13;
    background: #fffbeb;
}

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

.afce-stat,
.afce-summary-item {
    border: 1px solid #e2eaf3;
    border-radius: 8px;
    background: #fbfdff;
    padding: 12px;
    min-width: 0;
}

.afce-stat-value,
.afce-summary-item b {
    display: block;
    color: #102a43;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.afce-stat-label,
.afce-summary-item span {
    display: block;
    margin-top: 4px;
    color: var(--afce-muted);
    font-size: 12px;
    font-weight: 800;
}

.afce-file-list {
    display: grid;
    gap: 8px;
    max-height: 392px;
    overflow: auto;
    margin-top: 14px;
}

.afce-file-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #e4ebf3;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
}

.afce-file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--afce-primary);
    background: #e8f4fb;
}

.afce-file-name {
    color: #102a43;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.afce-file-meta {
    color: var(--afce-muted);
    font-size: 12px;
    line-height: 1.45;
}

.afce-file-tag {
    border: 1px solid #d7e3ef;
    border-radius: 999px;
    padding: 5px 8px;
    color: #31516f;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.afce-empty,
.afce-more-note {
    border: 1px dashed #c5d3e2;
    border-radius: 8px;
    color: var(--afce-muted);
    background: #fbfdff;
    padding: 16px;
    text-align: center;
    line-height: 1.65;
    font-size: 13px;
}

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

.afce-form-grid-two {
    margin-top: 14px;
}

.afce-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

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

.afce-field label {
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.afce-field input[type="text"],
.afce-field input[type="number"],
.afce-field select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cad7e6;
    border-radius: 7px;
    background: #ffffff;
    color: #172033;
    padding: 9px 10px;
    outline: none;
}

.afce-field input[type="text"]:focus,
.afce-field input[type="number"]:focus,
.afce-field select:focus {
    border-color: var(--afce-primary);
    box-shadow: 0 0 0 3px rgba(15, 111, 181, .13);
}

.afce-range-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px;
    align-items: center;
    gap: 10px;
    border: 1px solid #cad7e6;
    border-radius: 7px;
    padding: 9px 10px;
    background: #ffffff;
    min-height: 42px;
}

.afce-range-wrap input[type="range"] {
    width: 100%;
    accent-color: var(--afce-primary);
}

.afce-range-value {
    color: #17324f;
    background: #eef7fc;
    border-radius: 999px;
    padding: 5px 8px;
    text-align: center;
    font-weight: 900;
    font-size: 12px;
    white-space: nowrap;
}

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

.afce-quick {
    border: 1px solid #d9e4ef;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    min-height: 78px;
}

.afce-quick:hover {
    border-color: var(--afce-primary);
    background: #f3f9fc;
}

.afce-quick strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.afce-quick span {
    display: block;
    color: var(--afce-muted);
    font-size: 12px;
    line-height: 1.5;
}

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

.afce-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    border: 1px solid #dfe7f0;
    border-radius: 8px;
    padding: 11px;
    cursor: pointer;
    background: #ffffff;
}

.afce-check input {
    margin-top: 3px;
    accent-color: var(--afce-primary);
}

.afce-check b {
    display: block;
    color: #1f3348;
    font-size: 13px;
    line-height: 1.35;
}

.afce-check small {
    display: block;
    margin-top: 3px;
    color: var(--afce-muted);
    font-size: 12px;
    line-height: 1.45;
}

.afce-curve-block + .afce-curve-block,
.afce-canvas-card {
    margin-top: 14px;
}

.afce-curve-head,
.afce-canvas-head,
.afce-audio-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.afce-curve-head b,
.afce-canvas-head b,
.afce-audio-head b {
    color: #102a43;
    font-size: 14px;
    font-weight: 900;
}

.afce-curve-head span,
.afce-canvas-head span,
.afce-audio-head span {
    color: var(--afce-muted);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.afce-curve-btn {
    border: 1px solid #d8e3ee;
    border-radius: 8px;
    background: #ffffff;
    color: #24364b;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    min-height: 66px;
}

.afce-curve-btn:hover,
.afce-curve-btn.active {
    border-color: var(--afce-primary);
    background: #eef7fc;
}

.afce-curve-btn.active {
    box-shadow: 0 8px 18px rgba(15, 111, 181, .11);
}

.afce-curve-btn b {
    display: block;
    color: #102a43;
    font-size: 13px;
    margin-bottom: 3px;
}

.afce-curve-btn span {
    display: block;
    color: var(--afce-muted);
    font-size: 12px;
    line-height: 1.4;
}

.afce-canvas-card {
    border: 1px solid #dfe7f0;
    border-radius: 8px;
    padding: 12px;
    background: #fbfdff;
}

.afce-canvas-card canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2eaf3;
}

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

.afce-audio-box {
    border: 1px solid #dfe7f0;
    border-radius: 8px;
    background: #fbfdff;
    padding: 12px;
    min-width: 0;
}

.afce-audio-box audio {
    display: block;
    width: 100%;
    min-height: 42px;
}

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

.afce-progress-track {
    width: 100%;
    height: 26px;
    border-radius: 999px;
    background: #e6edf5;
    overflow: hidden;
}

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

.afce-status {
    min-height: 24px;
    margin-top: 10px;
    color: var(--afce-muted);
    line-height: 1.55;
    font-size: 13px;
}

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

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

.afce-status.warn {
    color: var(--afce-amber);
}

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

.afce-result-card {
    border: 1px solid #dfe7f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
    min-width: 0;
}

.afce-result-card audio {
    width: 100%;
    margin-bottom: 9px;
}

.afce-result-name {
    color: #102a43;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.afce-result-meta {
    color: var(--afce-muted);
    font-size: 12px;
    line-height: 1.55;
    margin: 5px 0 10px;
}

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

.afce-error-item {
    border: 1px solid #f2b8b8;
    border-radius: 8px;
    background: #fff5f5;
    color: var(--afce-danger);
    padding: 10px;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 1120px) {
    .afce-layout,
    .afce-layout-wide,
    .afce-preview-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .afce-notice {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .afce-engine {
        grid-column: 1 / -1;
        justify-self: start;
        white-space: normal;
    }

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

    .afce-quick-grid,
    .afce-curve-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .afce-nav {
        justify-content: stretch;
    }

    .afce-actions,
    .afce-actions-inline {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .afce-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .afce-panel-body,
    .afce-panel-head,
    .afce-notice {
        padding: 12px;
    }

    .afce-drop {
        min-height: 176px;
        padding: 18px;
    }

    .afce-quick-grid,
    .afce-curve-grid {
        grid-template-columns: 1fr;
    }

    .afce-range-wrap {
        grid-template-columns: 1fr;
    }

    .afce-range-value {
        justify-self: start;
    }

    .afce-file-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .afce-file-tag {
        grid-column: 1 / -1;
        justify-self: start;
    }
}
