/* YAML to Excel - mobile-first, unique layout */
.bmc-yaml .y2e-tool {
    --y2e-bg: #f8fafc;
    --y2e-surface: #ffffff;
    --y2e-border: #e2e8f0;
    --y2e-text: #0f172a;
    --y2e-muted: #64748b;
    --y2e-primary: #0d9488;
    --y2e-primary-hover: #0f766e;
    --y2e-primary-bg: #ccfbf1;
    --y2e-success: #059669;
    --y2e-success-bg: #ecfdf5;
    --y2e-error: #dc2626;
    --y2e-error-bg: #fef2f2;
    --y2e-radius: 12px;
    --y2e-radius-sm: 8px;
    --y2e-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --y2e-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.y2e-tool {
    margin-bottom: 2rem;
}

/* Bar: stats + actions - stacks on small screens */
.y2e-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--y2e-surface);
    border: 1px solid var(--y2e-border);
    border-radius: var(--y2e-radius);
    box-shadow: var(--y2e-shadow);
    margin-bottom: 1rem;
}

.y2e-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.y2e-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.y2e-stat-value {
    font-weight: 700;
    color: var(--y2e-text);
}

.y2e-stat-label {
    color: var(--y2e-muted);
    font-weight: 500;
}

.y2e-stat-sep {
    width: 1px;
    height: 1rem;
    background: var(--y2e-border);
}

.y2e-status-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.y2e-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--y2e-muted);
    flex-shrink: 0;
}

.y2e-tool.y2e-has-success .y2e-status-dot {
    background: var(--y2e-success);
    box-shadow: 0 0 0 2px var(--y2e-success-bg);
}

.y2e-tool.y2e-has-error .y2e-status-dot {
    background: var(--y2e-error);
    box-shadow: 0 0 0 2px var(--y2e-error-bg);
}

.y2e-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.y2e-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--y2e-radius-sm);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.y2e-btn:focus-visible {
    outline: 2px solid var(--y2e-primary);
    outline-offset: 2px;
}

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

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

.y2e-btn-secondary {
    background: var(--y2e-surface);
    color: var(--y2e-text);
    border: 1px solid var(--y2e-border);
}

.y2e-btn-secondary:hover {
    background: var(--y2e-bg);
    border-color: var(--y2e-primary);
    color: var(--y2e-primary);
}

.y2e-btn-ghost {
    background: transparent;
    color: var(--y2e-muted);
}

.y2e-btn-ghost:hover {
    background: var(--y2e-bg);
    color: var(--y2e-text);
}

/* Workspace: two panels - column on mobile, row on desktop */
.y2e-workspace {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 350px;
}

@media (min-width: 768px) {
    .y2e-workspace {
        flex-direction: row;
        min-height: 450px;
    }
}

.y2e-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--y2e-surface);
    border: 1px solid var(--y2e-border);
    border-radius: var(--y2e-radius);
    box-shadow: var(--y2e-shadow);
    overflow: hidden;
}

@media (min-width: 768px) {
    .y2e-panel:first-child {
        border-right-radius: 0;
        border-right-width: 0.5px;
    }

    .y2e-panel:last-child {
        border-left-radius: 0;
        border-left-width: 0.5px;
    }
}

.y2e-panel-head {
    padding: 0.625rem 1rem;
    background: var(--y2e-bg);
    border-bottom: 1px solid var(--y2e-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--y2e-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.y2e-panel-title {
    display: block;
}

.y2e-editor-wrap {
    flex: 1;
    min-height: 260px;
    position: relative;
}

@media (min-width: 768px) {
    .y2e-editor-wrap {
        min-height: 340px;
    }
}

.y2e-editor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.y2e-preview-wrap {
    flex: 1;
    min-height: 200px;
    padding: 1rem;
    overflow: auto;
    font-size: 0.8125rem;
}

@media (min-width: 768px) {
    .y2e-preview-wrap {
        min-height: 340px;
    }
}

.y2e-preview-placeholder {
    color: var(--y2e-muted);
    margin: 0;
}

/* Table preview */
.y2e-preview-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.y2e-preview-table-wrap:last-child {
    margin-bottom: 0;
}

.y2e-preview-sheet-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--y2e-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.y2e-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.y2e-preview-table th,
.y2e-preview-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid var(--y2e-border);
}

.y2e-preview-table th {
    background: var(--y2e-bg);
    font-weight: 600;
    color: var(--y2e-text);
}

.y2e-preview-table td {
    color: var(--y2e-text);
}

.y2e-preview-more {
    font-size: 0.75rem;
    color: var(--y2e-muted);
    text-align: center;
    padding: 0.5rem;
}

.y2e-preview-error {
    color: var(--y2e-error);
    margin: 0;
}

/* Edu section */
.y2e-edu {
    padding: 2rem 0;
    background: var(--y2e-bg);
    border-top: 1px solid var(--y2e-border);
}

.y2e-edu-inner {
    max-width: 640px;
}

.y2e-edu-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--y2e-text);
}

.y2e-edu-lead {
    font-size: 0.9375rem;
    color: var(--y2e-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.y2e-edu-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
    color: var(--y2e-muted);
    line-height: 1.7;
}

.y2e-edu-list li {
    margin-bottom: 0.5rem;
}

.y2e-edu-list code {
    font-size: 0.8125rem;
    padding: 0.15rem 0.35rem;
    background: var(--y2e-surface);
    border: 1px solid var(--y2e-border);
    border-radius: 4px;
}
