:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --accent: #3b82f6;
    --accent-soft: rgba(59,130,246,0.15);
    --border: #1f2937;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1f2937 0, #020617 50%, #000 100%);
    color: var(--text-main);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


.topbar {
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148,163,184,0.15);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem 0.4rem;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: conic-gradient(from 140deg, #38bdf8, #6366f1, #a855f7, #f97316, #38bdf8);
    padding: 2px;
}
.brand-logo-inner {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 600;
}
.brand-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.env-pill {
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    border: 1px solid rgba(148,163,184,0.35);
    color: var(--text-muted);
}

.tabs {
    display: flex;
    gap: 0.3rem;
    list-style: none;
    padding: 0;
    margin-top: .8rem;
}
.tab {
    padding: 0.4rem 0.9rem;
    border-radius: .6rem .6rem 0 0;
    color: var(--text-muted);
    cursor: pointer;
}

.tabs .tab a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;             
    text-decoration: none;     
}

.tab.active {
    opacity: 1;
    color: var(--text-main);   
    background: #1e293b;        
    border: 1px solid rgba(148,163,184,0.45);
    border-bottom-color: #1e293b;
}


.tab.inactive {
    opacity: 0.55;
}


.tab.inactive:hover {
    opacity: 0.85;
}


.tab.active:hover {
    opacity: 1;
}


.page {
    flex: 1;
}
.page-inner-wide {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h1 { font-size: 1.4rem; }
.subtitle { color: var(--text-muted); margin-bottom: 1rem; }


.card {
    background: rgba(15,23,42,0.9);
    border-radius: 1rem;
    border: 1px solid rgba(148,163,184,0.2);
    padding: 1.5rem;
}
.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.card-title { font-size: 1rem; font-weight: 600; }
.card-badge {
    background: var(--accent-soft);
    color: #bfdbfe;
    padding: .2rem .5rem;
    border-radius: .5rem;
    font-size: .75rem;
}


fieldset {
    border: 1px solid rgba(31,41,55,0.8);
    border-radius: .7rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
legend {
    color: var(--text-muted);
    font-size: .8rem;
    text-transform: uppercase;
}

label { display: block; margin-top: .6rem; }
input[type=text], input[type=password], select {
    width: 100%;
    margin-top: .2rem;
    padding: .45rem;
    border-radius: .5rem;
    border: 1px solid #374151;
    background: #020617;
    color: var(--text-main);
    font-size: .9rem;
}
input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.4);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .8rem;
}

.actions { text-align: right; margin-top: 1rem; }

button[type=submit] {
    background: #374151;
    border: none;
    border-radius: 999px;
    padding: .55rem 1.3rem;
    font-size: .9rem;
    color: #a2b2dd;
    cursor: pointer;
}


.output {
    margin-top: 1rem;
    padding: 1rem;
    background: #020617;
    border: 1px solid rgba(34,197,94,0.6);
    border-radius: .7rem;
    white-space: pre-wrap;
    max-height: 400px;
    overflow: auto;
}

.live-shot-wrapper {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .live-shot-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }
}

.run-panel {
    margin-top: 2rem;
    gap: 1.5rem;
    align-items: stretch;     
}

.run-panel.hidden {
    display: none;
}

.run-panel:not(.hidden) {
    display: flex;
    flex-wrap: nowrap;
}

@media (max-width: 900px) {
    .run-panel:not(.hidden) {
        flex-wrap: wrap;      
    }
}

.run-panel-col {
    flex: 1 1 0;
    min-width: 260px;
    display: flex;             
    flex-direction: column;
}

.live-shot-frame {
    position: relative;
    flex: 1 1 auto;           
    min-height: 200px;
    background: radial-gradient(circle at top, #1e293b, #020617);
    border-radius: 0.9rem;
    border: 1px solid rgba(30,64,175,0.6);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.live-shot-img {
    max-width: 100%;
    max-height: 100%;
    display: none;
    object-fit: contain;
}

.live-shot-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
}

.live-shot-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.current-step-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #e5e7eb;
}


.output {
    flex: 1 1 auto;         
    min-height: 200px;
    max-height: 500px;
    overflow: auto;
    background: #020617;
    border-radius: 0.6rem;
    border: 1px solid rgba(15,23,42,0.9);
    padding: 0.75rem 1rem;
    font-family: monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
}
