body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #050710 url("background.png") center/cover fixed no-repeat;
    color: #e5f4ff;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.overlay-toggle button {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #48d7ff;
    background: rgba(7, 13, 30, 0.9);
    color: #e5f4ff;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 8px rgba(72, 215, 255, 0.4);
}

.overlay-toggle button:hover {
    background: rgba(12, 30, 60, 0.95);
    transform: translateY(-1px);
}

/* Vollbild-Overlay */
.machine-overlay {
    position: relative;
    width: min(960px, 95vw);
    max-height: 90vh;
    padding: 18px 18px 14px;
    border-radius: 18px;
    background: radial-gradient(circle at top left, rgba(72, 215, 255, 0.22), transparent 55%), radial-gradient(circle at bottom right, rgba(255, 71, 133, 0.2), transparent 55%), rgba(3, 8, 22, 0.96);
    border: 1px solid rgba(120, 214, 255, 0.55);
    box-shadow:
        0 0 40px rgba(5, 204, 255, 0.4),
        0 0 0 1px rgba(7, 20, 40, 0.9);
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 10px;
    backdrop-filter: blur(16px);
    z-index: 5;
}

.machine-overlay.hidden {
    display: none;
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(120, 214, 255, 0.4);
    padding-bottom: 8px;
}

.overlay-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.overlay-title h1 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.overlay-title span {
    font-size: 11px;
    opacity: 0.8;
}

.status-leds {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-led {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.status-dot.green {
    color: #26ff88;
    background: #26ff88;
}

.status-dot.red {
    color: #ff4757;
    background: #ff4757;
}

.status-dot.yellow {
    color: #ffd76a;
    background: #ffd76a;
}

.overlay-controls {
    display: grid;
    grid-template-columns: 2fr 1.3fr;
    gap: 12px;
    font-size: 12px;
}

.control-group {
    border-radius: 12px;
    border: 1px solid rgba(150, 220, 255, 0.4);
    padding: 8px 10px;
    background: linear-gradient(135deg, rgba(8, 18, 40, 0.96), rgba(8, 14, 30, 0.96));
    box-shadow: inset 0 0 0 1px rgba(6, 16, 35, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.control-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    opacity: 0.85;
}

.button-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.machine-btn {
    position: relative;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(142, 227, 255, 0.9);
    background: radial-gradient(circle at top, rgba(120, 214, 255, 0.35), rgba(10, 26, 55, 1));
    color: #e9fbff;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        0 0 10px rgba(120, 214, 255, 0.6),
        inset 0 0 0 1px rgba(2, 8, 20, 0.9);
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

.machine-btn::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.machine-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.machine-btn:active,
.machine-btn.active {
    transform: translateY(1px);
    box-shadow:
        0 0 3px rgba(120, 214, 255, 0.7),
        inset 0 0 10px rgba(4, 15, 42, 1);
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.toggle input {
    display: none;
}

.toggle-track {
    width: 32px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, #394a6a, #182438);
    border: 1px solid rgba(129, 204, 255, 0.8);
    position: relative;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.9);
}

.toggle-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #b9f3ff);
    box-shadow: 0 0 8px rgba(120, 214, 255, 0.8);
    transition: transform 0.15s ease;
}

.toggle input:checked+.toggle-track .toggle-thumb {
    transform: translateX(14px);
}

.toggle-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.overlay-main {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 12px;
    margin-top: 4px;
    height: 100%;
}

.panel {
    border-radius: 12px;
    border: 1px solid rgba(120, 214, 255, 0.4);
    background: radial-gradient(circle at top, rgba(120, 214, 255, 0.1), rgba(5, 10, 28, 0.98));
    box-shadow: inset 0 0 0 1px rgba(3, 9, 24, 0.9);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    overflow: hidden;
}

.panel-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: 4px;
}

.panel-content-scroll {
    flex: 1;
    overflow: auto;
    padding-right: 6px;
}

.terminal {
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    font-size: 11px;
    color: #9fffea;
    background: #050912;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid rgba(93, 198, 255, 0.6);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.95);
    min-height: 90px;
    max-height: 150px;
    overflow: auto;
    line-height: 1.4;
}

.terminal-line {
    white-space: pre;
}

.terminal-line.dim {
    opacity: 0.75;
}

.terminal-line .tag {
    color: #ffd76a;
}

.terminal-line .ok {
    color: #26ff88;
}

.terminal-line .warn {
    color: #ffd76a;
}

.terminal-line .err {
    color: #ff4757;
}

.glow-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
    mix-blend-mode: screen;
}

.glow-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #4ff5ff;
    box-shadow: 0 0 8px #4ff5ff;
}

.glow-dot.red {
    background: #ff476e;
    box-shadow: 0 0 8px #ff476e;
}

.glow-dot.gold {
    background: #ffd76a;
    box-shadow: 0 0 8px #ffd76a;
}

.footer {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    font-size: 16px;
    color: var(--muted);
}


/* Scrollbars leicht anpassen */
.panel-content-scroll::-webkit-scrollbar,
.terminal::-webkit-scrollbar {
    width: 6px;
}

.panel-content-scroll::-webkit-scrollbar-thumb,
.terminal::-webkit-scrollbar-thumb {
    background: rgba(120, 214, 255, 0.5);
    border-radius: 999px;
}

.panel-content-scroll::-webkit-scrollbar-track,
.terminal::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 720px) {
    body {
        align-items: flex-end;
    }

    .machine-overlay {
        max-height: 85vh;
        grid-template-rows: auto auto auto;
    }

    .overlay-main {
        grid-template-columns: 1fr;
    }
}

.wish-input {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(3, 9, 24, 0.9);
    border: 1px solid rgba(120, 214, 255, 0.35);
}

.wish-input__row {
    display: grid;
    grid-template-columns: 0.9fr 1.3fr auto;
    gap: 6px;
    align-items: flex-end;
}

.wish-input label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}

.wish-input label span {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

.wish-input input {
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(120, 214, 255, 0.6);
    background: rgba(5, 10, 28, 0.95);
    color: #e5f4ff;
    font-size: 12px;
}

.wish-input button {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(142, 227, 255, 0.9);
    background: radial-gradient(circle at top, rgba(120, 214, 255, 0.35), rgba(10, 26, 55, 1));
    color: #e9fbff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow:
        0 0 10px rgba(120, 214, 255, 0.6),
        inset 0 0 0 1px rgba(2, 8, 20, 0.9);
}

.wish-input button:hover {
    filter: brightness(1.1);
}

.wish-input__feedback {
    margin-top: 4px;
    font-size: 10px;
    opacity: 0.85;
}

.jobs-pagination {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 11px;
    opacity: 0.9;
}

.jobs-pagination button {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(120, 214, 255, 0.7);
    background: rgba(5, 12, 30, 0.95);
    color: #e5f4ff;
    font-size: 11px;
    cursor: pointer;
}

.jobs-pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}