:root {
    --bg-top: #06111b;
    --bg-bottom: #10293e;
    --panel: rgba(8, 21, 33, 0.72);
    --panel-border: rgba(182, 219, 255, 0.15);
    --panel-strong: rgba(255, 255, 255, 0.06);
    --text-main: #edf7ff;
    --text-muted: #8dafc6;
    --accent: #67d4ff;
    --accent-strong: #86ffe0;
    --success: #4fe28a;
    --warning: #ffca63;
    --danger: #ff7d7d;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(103, 212, 255, 0.22), transparent 32%),
        radial-gradient(circle at 85% 12%, rgba(134, 255, 224, 0.18), transparent 28%),
        linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
    background: transparent;
}

.shell {
    width: min(1400px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 36px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 22px;
    padding: 28px;
    border: 1px solid var(--panel-border);
    border-radius: calc(var(--radius) + 8px);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
        rgba(4, 16, 26, 0.72);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    animation: rise-in 480ms ease-out;
}

.hero h1,
.panel h2,
.worker-name {
    margin: 0;
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.7rem);
}

.hero-text {
    max-width: 60ch;
    margin: 14px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.hero-meta {
    display: grid;
    gap: 14px;
}

.meta-card,
.panel,
.worker-card {
    border: 1px solid var(--panel-border);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.meta-card {
    padding: 18px 20px;
    border-radius: 20px;
}

.meta-label,
.eyebrow,
.worker-subtitle {
    color: var(--text-muted);
}

.meta-card strong {
    display: inline-flex;
    margin-top: 8px;
    font-size: 1rem;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1.05fr);
    gap: 22px;
    margin-top: 22px;
}

.panel {
    padding: 24px;
    border-radius: var(--radius);
    animation: rise-in 620ms ease-out;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 1.45rem;
}

.ghost-button,
.action-button,
.toolbar-link {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font: inherit;
    text-decoration: none;
    transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.ghost-button,
.action-button {
    padding: 10px 16px;
    cursor: pointer;
}

.ghost-button:hover,
.action-button:hover,
.toolbar-link:hover {
    transform: translateY(-1px);
    background: rgba(103, 212, 255, 0.1);
    border-color: rgba(103, 212, 255, 0.44);
}

.ghost-button:disabled,
.action-button:disabled {
    cursor: progress;
    opacity: 0.6;
    transform: none;
}

.worker-grid {
    display: grid;
    gap: 18px;
}

.worker-card {
    padding: 22px;
    border-radius: 22px;
}

.worker-topline {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
}

.worker-name {
    font-size: 1.35rem;
}

.worker-subtitle {
    margin: 8px 0 0;
    font-size: 0.95rem;
}

.status-pill,
.state-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #06111b;
    background: var(--accent);
}

.status-running,
.state-chip-live {
    background: var(--success);
}

.status-paused,
.status-warning,
.state-chip-pending {
    background: var(--warning);
}

.status-failed,
.status-canceled,
.state-chip-error {
    background: var(--danger);
}

.status-idle,
.status-notstarted {
    background: var(--accent);
}

.worker-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    margin: 22px 0;
}

.worker-facts div {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--panel-strong);
}

.worker-facts dt {
    margin-bottom: 6px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.worker-facts dd {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.45;
    word-break: break-word;
}

.worker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-button-warn {
    border-color: rgba(255, 125, 125, 0.28);
}

.panel-logs {
    display: flex;
    flex-direction: column;
}

.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.toolbar-link {
    padding: 8px 14px;
}

.log-stream {
    flex: 1;
    min-height: 620px;
    max-height: 72vh;
    overflow: auto;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--panel-border);
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.32)),
        rgba(4, 12, 19, 0.82);
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 0.9rem;
}

.log-entry {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.log-entry:last-child {
    border-bottom: 0;
}

.log-line {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.log-time,
.log-worker {
    color: var(--text-muted);
}

.log-level {
    font-weight: 700;
    text-transform: uppercase;
}

.log-level-info {
    color: var(--accent);
}

.log-level-warning {
    color: var(--warning);
}

.log-level-error,
.log-level-fatal {
    color: var(--danger);
}

.log-exception {
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 14px;
    overflow: auto;
    white-space: pre-wrap;
    background: rgba(255, 255, 255, 0.04);
    color: #ffd7d7;
}

.empty-state {
    padding: 24px;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    color: var(--text-muted);
    text-align: center;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .content-grid,
    .hero {
        grid-template-columns: 1fr;
    }

    .log-stream {
        min-height: 420px;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100vw - 18px, 100%);
        padding: 14px 0 20px;
    }

    .hero,
    .panel {
        padding: 18px;
    }

    .panel-header,
    .worker-topline {
        flex-direction: column;
        align-items: stretch;
    }

    .worker-facts,
    .log-line {
        grid-template-columns: 1fr;
    }

    .worker-actions {
        flex-direction: column;
    }
}
