@charset "utf-8";

.tool-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px 22px;
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
}

.tool-card__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tool-card__title > span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-card__title i {
    color: var(--primary-color);
    font-size: 14px;
}

.tool-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px 16px;
}

.tool-config-grid .form-group--wide {
    grid-column: span 2;
}

@media (max-width: 520px) {
    .tool-config-grid .form-group--wide {
        grid-column: 1 / -1;
    }
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid transparent;
    background: var(--input-bg);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2395a5a6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-select:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15);
}

.tool-config-grid .is-hidden,
.tool-config-grid .sig-standard.is-hidden,
.tool-config-grid .sig-platform.is-hidden,
.fx-currency-picker__panel.is-hidden {
    display: none;
}

.tool-hint.is-hidden {
    display: none;
}

.tool-panels {
    display: grid;
    grid-template-columns: minmax(0, 2fr) var(--tool-actions-col, 168px) minmax(0, 3fr);
    gap: 12px;
    align-items: stretch;
}

.tool-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tool-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.tool-panel__head .form-label {
    margin-bottom: 0;
}

.tool-panel textarea.form-control {
    flex: 1;
    min-height: 220px;
}

.tool-panel-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    width: var(--tool-actions-col, 168px);
    min-width: var(--tool-actions-col, 168px);
    padding: 8px 4px;
}

.tool-panel-actions .btn:not(.btn-swap):not(.btn-compact) {
    width: 100%;
    padding: 11px 14px;
    font-size: 13px;
}

.tool-panel-actions .btn-wide {
    white-space: nowrap;
}

.tool-panel-actions .btn-compact {
    width: 100%;
    padding: 9px 10px;
    font-size: 12px;
}

.tool-panel-actions .btn-swap {
    align-self: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--input-bg);
    color: var(--primary-color);
    box-shadow: none;
}

.tool-panel-actions .btn-swap:hover {
    background: #ede9fe;
    transform: rotate(180deg);
    box-shadow: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-outline {
    background: #fff;
    color: var(--text-light);
    border: 1px solid #e8eaef;
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: none;
    box-shadow: none;
}

.tool-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.55;
}

.tool-hint code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    background: var(--input-bg);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--primary-color);
}

.toast.success { border-left: 4px solid var(--success-text); }
.toast.success i { color: var(--success-text); }
.toast.error { border-left: 4px solid var(--danger-text); }
.toast.error i { color: var(--danger-text); }

textarea.form-control.is-error {
    border-color: #fca5a5;
    background: #fff5f5;
}

@media (max-width: 860px) {
    .tool-panels {
        grid-template-columns: 1fr;
    }
    .tool-panel-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        width: auto;
        min-width: 0;
        padding: 4px 0 8px;
    }
    .tool-panel-actions .btn:not(.btn-swap) { width: auto; min-width: 96px; }
    .tool-panel-actions .btn-wide { min-width: 168px; }
    .tool-panel textarea.form-control { min-height: 160px; }

    html.is-embed .tool-panels--grow {
        display: flex;
        flex-direction: column;
    }
    html.is-embed .tool-panels--grow .tool-panel {
        flex: 1;
        min-height: 100px;
    }
    html.is-embed .tool-panels--grow .tool-panel textarea.form-control {
        min-height: 0;
    }
}

@media (max-width: 640px) {
    .tool-page { padding: 20px 16px 32px; }
    html.is-embed .tool-page--fill { padding: 16px 16px 12px; }
}
