/* ==========================================
   Workflow Demo Surface — Styles
   Uses the app's theme variables (--bg, --bg-surface, --text, etc.)
   defined in variables.css for automatic dark/light support.
   ========================================== */

.ext-workflow-demo {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--sp-6) var(--sp-8);
}

/* Topbar */
.ext-workflow-demo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--sp-4);
}
.ext-workflow-demo-topbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

/* Subtitle */
.ext-workflow-demo-subtitle {
    color: var(--text-2);
    margin: 0 0 var(--sp-6);
    font-size: 0.9rem;
}

/* Grid */
.ext-workflow-demo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-6);
}
@media (min-width: 768px) {
    .ext-workflow-demo-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Card */
.ext-workflow-demo-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    color: var(--text);
}

/* Title row */
.ext-workflow-demo-card-title-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.ext-workflow-demo-card-title-row h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    color: var(--text);
}
.ext-workflow-demo-card-icon {
    font-size: 1.3rem;
}
.ext-workflow-demo-card-tier {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.ext-workflow-demo-badge-browser { background: var(--success-dim); color: var(--success-light); }
.ext-workflow-demo-badge-starlark { background: var(--accent-dim); color: var(--accent-light); }

/* Description */
.ext-workflow-demo-card-desc {
    color: var(--text-2);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Badges */
.ext-workflow-demo-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.ext-workflow-demo-card .ext-workflow-demo-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-raised);
    color: var(--text-2);
    white-space: nowrap;
}
.ext-workflow-demo-card .ext-workflow-demo-badge-installed { background: var(--success-dim); color: var(--success-light); }
.ext-workflow-demo-card .ext-workflow-demo-badge-not-installed { background: var(--warning-dim); color: var(--warning-light); }
.ext-workflow-demo-card .ext-workflow-demo-badge-needs-publish { background: var(--danger-dim); color: var(--danger-light); }

/* Stage flow diagram */
.ext-workflow-demo-stage-flow {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-1);
    flex-wrap: wrap;
    padding: var(--sp-3);
    background: var(--bg-raised);
    border-radius: 6px;
    overflow-x: auto;
}

.ext-workflow-demo-stage-node {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    min-width: 80px;
    text-align: center;
    background: var(--bg-surface);
    font-size: 0.75rem;
    color: var(--text);
}
.ext-workflow-demo-stage-node.ext-workflow-demo-stage-public {
    border-color: var(--success);
    background: var(--success-dim);
}
.ext-workflow-demo-stage-node.ext-workflow-demo-stage-system {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.ext-workflow-demo-stage-label {
    font-weight: 600;
    font-size: 0.8rem;
}
.ext-workflow-demo-stage-meta {
    color: var(--text-3);
    font-size: 0.65rem;
}
.ext-workflow-demo-stage-note {
    color: var(--warning-light);
    font-size: 0.6rem;
    font-style: italic;
    margin-top: 2px;
}

.ext-workflow-demo-stage-arrow {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-3);
    padding: 0 0.15rem;
    align-self: center;
}

/* Collapsible sections */
.ext-workflow-demo-card-collapsible {
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
}
.ext-workflow-demo-card-collapsible summary {
    padding: var(--sp-2) var(--sp-3);
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    color: var(--text);
}
.ext-workflow-demo-card-collapsible summary:hover {
    background: var(--bg-hover);
}
.ext-workflow-demo-collapsible-content {
    padding: 0 var(--sp-3) var(--sp-3);
}
.ext-workflow-demo-collapsible-content pre {
    background: var(--bg-raised);
    color: var(--text);
    padding: var(--sp-2);
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.72rem;
    line-height: 1.4;
    margin: var(--sp-1) 0;
    font-family: var(--mono);
}

/* Actions */
.ext-workflow-demo-card-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-top: auto;
    padding-top: var(--sp-2);
    border-top: 1px solid var(--border);
}
.ext-workflow-demo-card .ext-workflow-demo-btn {
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
}
/* demo-card buttons — uses kernel .sw-btn--primary */

/* Public link row */
.ext-workflow-demo-public-link-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-top: var(--sp-1);
}
.ext-workflow-demo-public-link-row input {
    flex: 1;
    font-size: 0.7rem;
    padding: var(--sp-1) var(--sp-2);
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--mono);
}
.ext-workflow-demo-public-link-row .ext-workflow-demo-btn-copy {
    padding: var(--sp-1) var(--sp-3);
    font-size: 0.7rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-2);
    cursor: pointer;
}
.ext-workflow-demo-public-link-row .ext-workflow-demo-btn-copy:hover {
    background: var(--bg-hover);
}
