:root {
    color-scheme: dark;
    --bg: #111318;
    --panel: #1b2028;
    --panel-strong: #242b35;
    --text: #eef2f5;
    --muted: #a8b3bd;
    --line: #39424e;
    --accent: #4fb286;
    --accent-strong: #7ad1a8;
    --danger: #ef6f6c;
    --warning: #f3b85b;
    --shadow: 0 18px 50px rgb(0 0 0 / 28%);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

code {
    color: var(--accent-strong);
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-shell {
    width: min(100%, 420px);
}

.login-panel,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-panel {
    padding: 2rem;
}

.login-panel h1,
.topbar h1,
.panel h2,
.empty-state h3 {
    margin: 0;
    line-height: 1.15;
}

.login-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.login-form label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d1015;
    color: var(--text);
    padding: 0.8rem 0.9rem;
}

.login-form button,
.secondary-button,
.icon-button {
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--accent);
    color: #06110c;
    font-weight: 700;
    min-height: 2.6rem;
}

.login-form button {
    margin-top: 0.5rem;
}

.notice {
    margin-top: 1.25rem;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    line-height: 1.45;
}

.notice-warning {
    border: 1px solid color-mix(in srgb, var(--warning) 60%, transparent);
    background: rgb(243 184 91 / 12%);
}

.notice-error {
    border: 1px solid color-mix(in srgb, var(--danger) 60%, transparent);
    background: rgb(239 111 108 / 12%);
}

.dashboard-page {
    padding: 1rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.5rem;
    padding: 0.5rem 0.25rem 1rem;
}

.logout-form,
.slider-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-chip {
    max-width: 16rem;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.secondary-button {
    padding: 0 0.9rem;
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(320px, 38%) minmax(0, 1fr);
    gap: 1rem;
    height: calc(100vh - 6.5rem);
    min-height: 560px;
}

.panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.panel-heading,
.slider-header {
    border-bottom: 1px solid var(--line);
    padding: 1rem;
}

.slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.slide-counter {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    padding: 0;
    font-size: 1.35rem;
}

.icon-button.wide {
    width: 5.25rem;
    flex-basis: 5.25rem;
    font-size: 0.95rem;
}

.camera-frame,
.iframe-frame {
    position: relative;
    display: grid;
    flex: 1;
    min-height: 0;
    place-items: stretch;
    background: #080a0d;
}

.camera-media,
.slide-frame {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.slide-frame {
    background: #fff;
}

.is-hidden {
    display: none;
}

.camera-js-status {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    margin: 0;
    border-radius: 6px;
    background: rgb(0 0 0 / 72%);
    color: var(--muted);
    padding: 0.55rem 0.7rem;
}

.empty-state {
    align-self: center;
    justify-self: center;
    width: min(100% - 2rem, 34rem);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    padding: 1.25rem;
    text-align: center;
}

.empty-state p {
    margin: 0.75rem 0 0;
    color: var(--muted);
    line-height: 1.45;
}

@media (max-width: 980px) {
    .dashboard-page {
        padding: 0.75rem;
    }

    .topbar,
    .slider-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .camera-panel {
        min-height: 42vh;
    }

    .slider-panel {
        min-height: 58vh;
    }
}

@media (max-width: 560px) {
    .logout-form {
        align-items: stretch;
        width: 100%;
        flex-direction: column;
    }

    .secondary-button {
        width: 100%;
    }

    .slider-controls {
        width: 100%;
    }

    .icon-button {
        flex: 1 1 0;
        width: auto;
    }

    .icon-button.wide {
        flex-basis: 5.25rem;
    }
}
