:root {
    --danger: #ff4d6d;
    --blue: #5cc8ff;
    --primary: #47ffcb;
    --bg-dark: #05070a;
    --panel-bg: rgba(8,14,18,0.92);
    --panel-soft: rgba(10,24,30,0.72);
    --line: rgba(71,255,203,0.28);
    --line-strong: rgba(71,255,203,0.62);
    --text: #d9fff5;
    --muted: #6fa99c;
    --warning: #ffd166;
    --shadow: 0 0 26px rgba(71,255,203,0.08);
}

* {
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: 0;
    height: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(71,255,203,0.08), transparent 28%),
        radial-gradient(circle at 80% 80%, rgba(92,200,255,0.08), transparent 26%),
        linear-gradient(180deg, #030506, var(--bg-dark));
    background-attachment: fixed;
    color: var(--text);
    font-family: Consolas, Monaco, "Courier New", monospace;
    padding-bottom: 50px;
    overflow-x: hidden;
}

.intro-page,
.intro-page *,
.terminal-page,
.terminal-page * {
    -webkit-user-select: none;
    user-select: none;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.035) 0px,
        rgba(255,255,255,0.035) 1px,
        transparent 2px,
        transparent 4px
    );
    opacity: 0.2;
    z-index: 5;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(71,255,203,0.04), transparent);
    animation: scan 7s linear infinite;
    z-index: 6;
}

@keyframes scan {
    from { transform: translateX(0); }
    to { transform: translateX(200%); }
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 30px 16px;
}

.app {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 42px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
}

.scene-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 320px;
    gap: 16px;
    margin-top: 16px;
    align-items: start;
}

.scene-page .app {
    overflow-x: hidden;
}

body.scene-page {
    padding-bottom: 76px;
}

body.terminal-page {
    padding-bottom: 76px;
}

.scene-page .scene-grid {
    overflow-x: auto;
    scrollbar-width: none;
    grid-template-columns: 260px minmax(708px, 1fr) 320px;
}

.scene-page .scene-grid::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.scene-page .right-col {
    grid-column: auto;
}

.terminal-page .container {
    max-width: none;
    width: min(1100px, calc(100% - 32px));
    overflow-x: hidden;
}

.terminal-page .grid {
    overflow-x: auto;
    scrollbar-width: none;
    grid-template-columns: 770px 280px;
}

.terminal-page .grid::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.scene-scrollbar-proxy,
.terminal-scrollbar-proxy,
.decrypt-scrollbar-proxy {
    position: fixed;
    left: 50%;
    bottom: 50px;
    z-index: 10000;
    width: min(1320px, calc(100% - 32px));
    height: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    transform: translateX(-50%);
    background: rgba(3,8,10,0.94);
    border: 1px solid rgba(71,255,203,0.28);
    opacity: 0;
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) rgba(3,8,10,0.94);
}

.scene-scrollbar-proxy.is-visible,
.terminal-scrollbar-proxy.is-visible,
.decrypt-scrollbar-proxy.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.scene-scrollbar-proxy::-webkit-scrollbar,
.terminal-scrollbar-proxy::-webkit-scrollbar,
.decrypt-scrollbar-proxy::-webkit-scrollbar {
    width: 0;
    height: 10px;
}

.scene-scrollbar-proxy::-webkit-scrollbar-track,
.terminal-scrollbar-proxy::-webkit-scrollbar-track,
.decrypt-scrollbar-proxy::-webkit-scrollbar-track {
    background: rgba(3,8,10,0.94);
}

.scene-scrollbar-proxy::-webkit-scrollbar-thumb,
.terminal-scrollbar-proxy::-webkit-scrollbar-thumb,
.decrypt-scrollbar-proxy::-webkit-scrollbar-thumb {
    background: var(--line-strong);
}

.scene-scrollbar-proxy-inner,
.terminal-scrollbar-proxy-inner,
.decrypt-scrollbar-proxy-inner {
    height: 1px;
}

.panel {
    position: relative;
    border: 1px solid var(--line);
    background: var(--panel-bg);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    min-height: 120px;
    overflow: hidden;
}

.panel::before,
.topbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.65;
}

.compact-panel {
    min-height: auto;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(71,255,203,0.035);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
}

.panel-body {
    padding: 18px;
}

.compact-body {
    padding: 8px;
}

h1 {
    color: var(--primary);
    text-shadow: 0 0 14px rgba(71,255,203,0.45);
}

.muted {
    color: var(--muted);
}

.terminal-line {
    margin: 0 0 10px;
    line-height: 1.5;
}

.prompt {
    color: var(--primary);
}

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

.current-user-marker {
    color: var(--warning);
}

.danger {
    color: var(--danger);
}

.blue {
    color: var(--blue);
}

.success,
.success-line {
    color: var(--primary);
}

.invisible-text {
    color: transparent !important;
    text-shadow: none !important;
}

.white-text {
    color: var(--text);
}

.error {
    color: var(--danger);
}

.button,
button,
.primary-button {
    display: inline-block;
    margin: 8px 8px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    color: var(--primary);
    background: rgba(71,255,203,0.1);
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    transition: 0.16s ease;
}

.button:hover,
button:hover,
.primary-button:hover {
    background: rgba(71,255,203,0.18);
    box-shadow: 0 0 18px rgba(71,255,203,0.13);
}

.status-box {
    border: 1px solid rgba(71,255,203,0.18);
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(71,255,203,0.04);
}

.logo-signal {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: 0.12em;
    text-shadow:
        0 0 10px rgba(71,255,203,0.6),
        0 0 22px rgba(71,255,203,0.4);
}

.logo-signal .glitch {
    font-size: inherit;
}

.signal-logo-link {
    color: inherit;
    text-decoration: none;
}

.signal-logo-link:hover {
    color: inherit;
    text-decoration: none;
}

.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0.55;
    pointer-events: none;
}

.glitch::before {
    color: var(--danger);
    transform: translate(1px, 0);
    clip-path: inset(0 0 56% 0);
    animation: glitch-a 2.8s infinite linear alternate-reverse;
}

.glitch::after {
    color: var(--blue);
    transform: translate(-1px, 0);
    clip-path: inset(48% 0 0 0);
    animation: glitch-b 3.1s infinite linear alternate-reverse;
}

@keyframes glitch-a {
    0%, 80%, 100% { transform: translate(1px, 0); }
    82% { transform: translate(4px, -1px); }
    84% { transform: translate(-3px, 1px); }
}

@keyframes glitch-b {
    0%, 78%, 100% { transform: translate(-1px, 0); }
    81% { transform: translate(-5px, 1px); }
    85% { transform: translate(3px, -1px); }
}

label {
    display: block;
    margin-top: 16px;
    color: var(--muted);
}

input,
textarea,
select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid rgba(71,255,203,0.35);
    background: #05070a;
    color: var(--text);
    font: inherit;
}

option.option-danger {
    color: var(--danger);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.install-page input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus,
.install-page input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus-visible,
.install-page textarea:focus,
.install-page textarea:focus-visible,
.install-page select:focus,
.install-page select:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: rgba(71,255,203,0.35) !important;
    background-color: #05070a !important;
}

.install-page input:-webkit-autofill,
.install-page input:-webkit-autofill:hover,
.install-page input:-webkit-autofill:focus,
.install-page textarea:-webkit-autofill,
.install-page textarea:-webkit-autofill:hover,
.install-page textarea:-webkit-autofill:focus,
.install-page select:-webkit-autofill,
.install-page select:-webkit-autofill:hover,
.install-page select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text);
    box-shadow: 0 0 0 1000px #05070a inset !important;
    border-color: rgba(71,255,203,0.35) !important;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--muted);
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page.info-page {
    align-items: flex-start;
    padding-top: 24px;
}

.login-panel {
    width: min(460px, calc(100% - 32px));
    border: 1px solid rgba(71,255,203,0.35);
    background: rgba(8,14,18,0.94);
    box-shadow: 0 0 24px rgba(71,255,203,0.08);
    padding: 28px;
}

.login-panel h1 {
    margin-top: 0;
    letter-spacing: 0.08em;
}

.banned-page .logo-signal {
    margin-bottom: 28px;
}

.login-panel p {
    color: var(--muted);
    line-height: 1.5;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--line);
    background: rgba(5,10,13,0.84);
    box-shadow: var(--shadow);
    padding: 24px 26px;
    position: relative;
    overflow: hidden;
}

.brand h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: 0.14em;
    text-shadow:
        0 0 10px rgba(71,255,203,0.6),
        0 0 22px rgba(71,255,203,0.4);
}

.brand h1 .glitch {
    font-size: inherit;
    line-height: inherit;
}

.brand span {
    color: var(--muted);
    font-size: 0.84rem;
}

.status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0.82rem;
}

.chip {
    border: 1px solid var(--line);
    padding: 8px 10px;
    background: rgba(71,255,203,0.045);
    color: var(--primary);
}

.status .chip {
    min-height: 33px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
}

.topbar-admin-button,
.topbar-music-button,
.topbar-options-button,
.topbar-logout-button {
    min-height: 33px;
    height: auto;
    margin: 0;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1;
}

.topbar-music-button[hidden] {
    display: none;
}

.signal0-admin-pending-button.has-pending {
    color: var(--warning);
    border-color: rgba(255,209,102,0.75);
    background: rgba(255,209,102,0.08);
}

.signal0-admin-pending-button.has-pending:hover {
    background: rgba(255,209,102,0.16);
    box-shadow: 0 0 18px rgba(255,209,102,0.12);
}

.terminal-button,
.nav-link {
    width: 100%;
    display: block;
    text-align: left;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    font: inherit;
    padding: 11px 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.16s ease;
    text-decoration: none;
}

.compact-link {
    padding: 8px 9px;
    margin-bottom: 4px;
    font-size: 0.78rem;
}

.game-nav-log-button {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    text-align: left;
}

.nav-unread-badge {
    color: var(--warning);
    font-size: 0.78em;
    white-space: nowrap;
}

.terminal-button:hover,
.nav-link:hover,
.nav-link.active {
    border-color: var(--line-strong);
    color: var(--primary);
    background: rgba(71,255,203,0.07);
    text-shadow: 0 0 10px rgba(71,255,203,0.55);
}

.scene-title {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 3vw, 2.1rem);
    color: var(--text);
}

.scene-subtitle {
    color: var(--muted);
    margin-bottom: 22px;
    line-height: 1.5;
}

.terminal {
    background: rgba(0,0,0,0.36);
    border: 1px solid rgba(71,255,203,0.2);
    padding: 14px;
    min-height: 280px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.terminal-typing-source {
    display: none;
}

.terminal-typed {
    white-space: normal;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.intro-terminal-text {
    margin: 0;
    color: inherit;
    font: inherit;
    line-height: 1.5;
    white-space: pre-wrap;
}

.terminal-loader {
    margin: 12px 0 4px;
    padding: 10px 12px;
    border: 1px solid rgba(71,255,203,0.32);
    background:
        linear-gradient(90deg, rgba(71,255,203,0.08), rgba(71,255,203,0.015)),
        rgba(0,0,0,0.28);
    box-shadow: inset 0 0 22px rgba(71,255,203,0.08), 0 0 18px rgba(71,255,203,0.08);
}

.terminal-loader-head {
    margin-bottom: 8px;
    color: var(--primary);
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(71,255,203,0.45);
}

.terminal-loader-track {
    height: 10px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.025);
    overflow: hidden;
}

.terminal-loader-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(71,255,203,0.4), rgba(71,255,203,0.95), rgba(255,255,255,0.85));
    box-shadow: 0 0 16px rgba(71,255,203,0.65);
    transition: width 0.08s linear;
}

.terminal-loader-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.terminal-waiting {
    opacity: 0;
    transition: opacity 0.25s ease;
    margin-top: 16px;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.terminal.typing-done .terminal-waiting {
    opacity: 1;
}

.terminal-history-html,
.pending-html-step {
    margin-bottom: 14px;
}

.scene-text p,
.terminal p,
.line {
    margin: 0 0 9px;
    line-height: 1.5;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cursor::after {
    content: "█";
    color: var(--primary);
    animation: blink 0.95s steps(2, start) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.input-row input,
.input-row textarea {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    background: rgba(3,8,10,0.94);
    color: var(--primary);
    padding: 12px;
    font: inherit;
    outline: none;
}

.input-row textarea {
    min-height: calc(2.9em + 26px);
    resize: none;
    overflow-y: hidden;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.command-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: center;
}

.input-row .command-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-top: 0;
    padding: 0 12px;
    white-space: nowrap;
}

.input-row .reset-command-button {
    border-color: rgba(255,209,102,0.76);
    color: var(--warning);
    background: rgba(255,209,102,0.08);
}

.input-row .reset-command-button:hover {
    background: rgba(255,209,102,0.16);
    box-shadow: 0 0 18px rgba(255,209,102,0.12);
}

.scene-command-paused .command-actions {
    visibility: hidden;
    pointer-events: none;
}

.scene-decrypt-status {
    margin-top: 16px;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(71,255,203,0.45);
}

.item {
    border: 1px solid rgba(71,255,203,0.16);
    background: var(--panel-soft);
    padding: 12px;
    margin-bottom: 10px;
}

.item strong {
    display: block;
    color: var(--text);
    margin-bottom: 5px;
}

.item span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.file-log,
.chapter-archive {
    border: 1px solid rgba(71,255,203,0.16);
    background: rgba(255,255,255,0.02);
}

.file-log summary,
.chapter-archive summary {
    padding: 10px;
    color: var(--primary);
    cursor: pointer;
    list-style: none;
}

.file-log summary::-webkit-details-marker,
.chapter-archive summary::-webkit-details-marker {
    display: none;
}

.file-log summary::before,
.chapter-archive summary::before {
    content: "> ";
    color: var(--primary);
}

.file-log[open] summary,
.chapter-archive[open] summary {
    border-bottom: 1px solid rgba(71,255,203,0.16);
    background: rgba(71,255,203,0.05);
}

.file-list {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.file-entry {
    border: 1px solid rgba(71,255,203,0.14);
    background: rgba(10,24,30,0.48);
    padding: 10px;
}

.file-entry strong {
    display: block;
    margin-bottom: 5px;
}

.file-entry span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.file-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.82rem;
    display: inline-block;
    margin-top: 8px;
}

.file-link:hover {
    text-decoration: underline;
}

.file-link.button {
    font-size: inherit;
    text-decoration: none;
}

.terminal-typed .button,
.terminal-waiting .button {
    display: table;
    margin: 12px 0 0;
    width: fit-content;
}

.terminal-typed .scene-media,
.terminal-waiting .scene-media {
    margin: 12px 0 0;
}

.terminal-typed .scene-media .button,
.terminal-waiting .scene-media .button {
    margin: 0;
}


.archive-list {
    display: grid;
    gap: 8px;
}

.archive-entry {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    color: var(--text);
    background: rgba(255,255,255,0.015);
    text-decoration: none;
    border-bottom: 1px solid rgba(71,255,203,0.1);
}

.archive-entry:last-child {
    border-bottom: none;
}

.archive-entry:hover,
.archive-entry.active {
    color: var(--primary);
    background: rgba(71,255,203,0.07);
}

.footer-log {
    margin-top: 16px;
    border: 1px solid var(--line);
    background: rgba(5,10,13,0.74);
    padding: 12px 14px;
    color: var(--muted);
    font-size: 0.82rem;
}

.mt-16 {
    margin-top: 16px;
}

.scene-continue-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 16px 8px 0 0;
    padding: 12px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    border-top: 1px solid rgba(71,255,203,0.35);
    background: linear-gradient(
        to top,
        rgba(8,14,18,0.95),
        rgba(8,14,18,0.65)
    );
    backdrop-filter: blur(6px);
    box-shadow:
        0 -4px 20px rgba(71,255,203,0.08),
        0 0 40px rgba(71,255,203,0.05) inset;
    padding: 6px 12px;
    font-size: 0.75rem;
    line-height: 1.2;
    pointer-events: none;
}

.site-footer .terminal-line {
    margin: 0;
}

.site-footer a {
    pointer-events: auto;
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(71,255,203,0.4);
}

.site-footer a:hover {
    color: #ffffff;
    border-bottom: 1px solid var(--primary);
}

.status-box a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(71,255,203,0.4);
}

.status-box a:hover {
    color: #ffffff;
    border-bottom: 1px solid var(--primary);
}

.bugtracker-inline-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(71,255,203,0.4);
}

.bugtracker-inline-link:hover {
    color: #ffffff;
    border-bottom: 1px solid var(--primary);
}

.bugtracker-attachment {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 16px;
}

.bugtracker-image-button {
    display: block;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(71,255,203,0.35);
    background: transparent;
    cursor: pointer;
}

.bugtracker-image-button img {
    display: block;
    max-width: 220px;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.bugtracker-attachment-name {
    color: var(--muted);
    max-width: 220px;
    overflow-wrap: anywhere;
}

.bug-link-list {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.bug-link-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr);
    gap: 8px;
}

.bug-link-row select,
.bug-link-row input {
    margin: 0;
}

.bug-file-dropzone {
    position: relative;
    display: grid;
    gap: 6px;
    min-height: 96px;
    padding: 18px;
    border: 1px dashed rgba(71,255,203,0.45);
    background: rgba(3,10,12,0.72);
    color: var(--text);
    cursor: pointer;
}

.bug-file-dropzone.is-dragover {
    background: rgba(71,255,203,0.08);
    border-color: var(--primary);
}

.bug-file-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.bug-file-dropzone small {
    color: var(--muted);
}

.bug-file-list {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.compact-button {
    width: max-content;
}

.bug-page-link-form {
    max-width: none;
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

.bug-page-link-form input {
    min-width: 280px;
    flex: 1 1 360px;
    margin: 0;
}

.bug-page-link-form button {
    margin: 0;
    white-space: nowrap;
}

body.bugtracker-page .bugtracker-search-form.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    max-width: none;
    flex-wrap: nowrap;
}

body.bugtracker-page .bugtracker-search-form.search-form input,
body.bugtracker-page .bugtracker-search-form.search-form select,
body.bugtracker-page .bugtracker-search-form.search-form button,
body.bugtracker-page .bugtracker-search-form.search-form .button {
    display: inline-flex;
    margin: 0;
    padding: 8px 10px;
}

body.bugtracker-page .bugtracker-search-form.search-form input {
    flex: 0 0 320px;
    width: 320px;
    min-width: 0;
    max-width: 320px;
}

body.bugtracker-page .bugtracker-search-form.search-form select {
    flex: 0 0 164px;
    width: 164px;
    min-width: 164px;
    max-width: 164px;
}

body.bugtracker-page .bugtracker-search-form.search-form button,
body.bugtracker-page .bugtracker-search-form.search-form .button {
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    white-space: nowrap;
}

.bug-status {
    font-weight: 700;
}

.bug-status-a_verifier {
    color: var(--text);
}

.bug-status-a_traiter {
    color: var(--danger);
    border-color: rgba(255,77,109,0.55);
    background: rgba(255,77,109,0.06);
}

.bug-status-en_cours {
    color: var(--warning);
    border-color: rgba(255,209,102,0.55);
    background: rgba(255,209,102,0.06);
}

.bug-status-resolu {
    color: var(--primary);
    border-color: rgba(71,255,203,0.55);
    background: rgba(71,255,203,0.06);
}

.bug-status-form {
    max-width: none;
}

.bug-status-controls {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

.bug-status-controls select {
    width: auto;
    min-width: 13ch;
    max-width: 15ch;
    flex: 0 0 auto;
}

.bug-status-controls button {
    margin: 6px 0 0;
    white-space: nowrap;
    flex: 0 0 auto;
}

.bugtracker-table {
    table-layout: fixed;
}

.bugtracker-table th:nth-child(1),
.bugtracker-table td:nth-child(1) {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
}

.bugtracker-table th:nth-child(2),
.bugtracker-table td:nth-child(2) {
    width: 20%;
    min-width: 180px;
}

.bugtracker-table th:nth-child(3),
.bugtracker-table td:nth-child(3) {
    width: 31%;
    min-width: 260px;
}

.bugtracker-table th:nth-child(4),
.bugtracker-table td:nth-child(4) {
    width: 13%;
    min-width: 126px;
}

.bugtracker-table th:nth-child(5),
.bugtracker-table td:nth-child(5) {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

.bugtracker-table th:nth-child(6),
.bugtracker-table td:nth-child(6) {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
}

.bugtracker-table th:nth-child(7),
.bugtracker-table td:nth-child(7) {
    width: 158px;
    min-width: 158px;
    max-width: 158px;
    box-sizing: border-box;
}

.bugtracker-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    max-height: 2.9em;
    overflow-wrap: anywhere;
}

.bugtracker-table .actions {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 3px;
    height: 100%;
}

.bugtracker-table td[data-label="Actions"] {
    vertical-align: middle;
}

.bugtracker-table .actions form {
    display: block;
    width: 86px;
    margin: 0;
    line-height: 0;
}

.bugtracker-table .actions a,
.bugtracker-table .actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 22px;
    box-sizing: border-box;
    margin: 0;
    padding: 3px 10px;
    line-height: 1;
    font-size: 0.76rem;
    text-align: center;
    white-space: nowrap;
}

.bug-comment-form {
    max-width: none;
}

.bug-comment-input-row {
    align-items: stretch;
}

.bug-comment-input-row textarea {
    min-height: calc(2.9em + 26px);
    resize: none;
    overflow-y: hidden;
    outline: none;
}

.bug-comment-input-row textarea:focus {
    outline: none;
    box-shadow: none;
}

.bug-comment-input-row button {
    white-space: nowrap;
}

.cgu-accept-row a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(71,255,203,0.4);
}

.cgu-accept-row a:hover {
    color: #ffffff;
    border-bottom: 1px solid var(--primary);
}

.cgu-panel p a:not(.button) {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(71,255,203,0.4);
}

.cgu-panel p a:not(.button):hover {
    color: #ffffff;
    border-bottom: 1px solid var(--primary);
}

.footer-inner {
    max-width: 1100px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.site-footer .muted {
    color: var(--muted);
}

.site-footer .glitch::before,
.site-footer .glitch::after {
    opacity: 0.35;
}

.hidden {
    display: none;
}

.hint {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.small {
    min-height: 90px;
}

.editor-wrapper {
    margin-top: 6px;
    border: 1px solid rgba(71,255,203,0.35);
    background: #05070a;
}

.editor-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid rgba(71,255,203,0.25);
    background: #071014;
    box-shadow: 0 8px 16px rgba(3, 5, 6, 0.72);
}

.editor-wrapper.is-toolbar-floating {
    padding-top: var(--editor-toolbar-height, 0px);
}

.editor-wrapper.is-toolbar-floating .editor-toolbar {
    position: fixed;
    top: 0;
    left: var(--editor-toolbar-left, 0px);
    width: var(--editor-toolbar-width, auto);
}

.editor-toolbar button,
.editor-toolbar select,
.editor-toolbar input[type="color"] {
    width: auto;
    margin: 0;
    padding: 8px;
    font-size: 0.9rem;
}

.editor-toolbar select {
    min-width: 130px;
}

.editor-toolbar input[type="color"] {
    width: 44px;
    height: 36px;
    padding: 2px;
}

.editor-toolbar .color-apply-button {
    min-width: 38px;
    padding-inline: 8px;
}

#scene_editor {
    min-height: 320px;
    padding: 16px;
    outline: none;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
}

#scene_editor:focus {
    box-shadow: inset 0 0 18px rgba(71,255,203,0.08);
}

#scene_editor a {
    color: var(--primary);
}

#scene_editor pre,
#scene_editor code {
    color: var(--primary);
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(71,255,203,0.25);
}

#scene_editor pre {
    padding: 14px;
    white-space: pre-wrap;
}

#scene_editor code {
    display: inline-block;
    padding: 2px 6px;
}

#scene_editor .scene-command-marker {
    color: var(--text) !important;
    background: transparent !important;
    font-weight: 400 !important;
    font-style: normal !important;
    text-decoration: none !important;
    -webkit-user-select: text;
    user-select: text;
    pointer-events: auto;
    caret-color: var(--primary);
}

.scene-media {
    margin-top: 12px;
}

.scene-media img {
    max-width: 100%;
    height: auto;
    border: 1px solid rgba(71,255,203,0.35);
}

.scene-media audio,
.scene-media video {
    width: 100%;
}

.scene-media-preview {
    display: grid;
    gap: 10px;
    align-items: start;
}

.scene-media-preview .scene-media {
    margin-top: 8px;
}

.scene-media-preview .scene-media img {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 140px;
    object-fit: contain;
}

.scene-media-preview .scene-media video {
    display: block;
    width: min(100%, 320px);
    max-height: 180px;
    object-fit: contain;
}

.scene-media-preview .panel-audio {
    width: min(100%, 360px);
    margin: 8px 0 0;
}

.scene-media-preview .panel-audio .panel-body {
    min-height: 54px;
    padding: 8px;
}

.scene-media-preview .audio-progress-row input.audio-progress[type="range"] {
    width: min(180px, 58%) !important;
}

.scene-media-preview .compact-audio {
    justify-content: flex-start;
}

.scene-media-preview .compact-audio .audio-download {
    min-width: 78px;
}

.scene-media-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scene-media-links .button {
    margin: 0;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th,
td {
    border: 1px solid rgba(71,255,203,0.22);
    padding: 11px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--primary);
    background: rgba(71,255,203,0.06);
    font-weight: normal;
}

td {
    color: var(--text);
}

.scene-file-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.72);
}

.scene-file-modal.hidden {
    display: none;
}

.scene-file-dialog {
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.scene-special-settings-dialog {
    width: min(1060px, calc(100vw - 32px));
    height: min(860px, calc(100vh - 48px));
    overflow: hidden;
}

.scene-special-settings-dialog .panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: calc(100% - 42px);
}

.scene-special-settings-dialog iframe {
    width: 100%;
    min-height: 0;
    flex: 1;
    border: 1px solid var(--line);
    background: #05070a;
}

.scene-file-picker {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--line);
    background: rgba(3,8,10,0.42);
    padding: 10px;
}

.scene-file-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.scene-file-filters button {
    margin: 0;
    padding: 8px 10px;
}

.scene-file-filters button.active {
    background: rgba(71,255,203,0.18);
    box-shadow: 0 0 18px rgba(71,255,203,0.12);
}

.scene-file-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text);
}

.scene-file-option.hidden {
    display: none;
}

.scene-file-option input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.scene-file-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .scene-selected-file {
        grid-template-columns: 1fr;
    }

    .scene-selected-file-actions {
        justify-content: flex-start;
    }
}

.blocked-users-list {
    display: grid;
    gap: 8px;
}

.blocked-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(71,255,203,0.25);
    background: rgba(3,8,10,0.35);
}

.blocked-user-row span {
    overflow-wrap: anywhere;
}

.blocked-user-row form {
    margin: 0;
    display: flex;
    align-items: center;
    align-self: center;
}

.blocked-user-row .button,
.blocked-user-row button {
    min-height: 0;
    height: 24px;
    margin: 0;
    padding: 0 8px;
    font-size: 0.78rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.terminal-welcome-body {
    padding-top: 12px;
    padding-bottom: 12px;
}

.terminal-welcome-content {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.terminal-welcome-body h1 {
    margin: 0 0 6px;
}

.terminal-welcome-body p {
    margin: 0;
}

.terminal-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.terminal-top-actions .button {
    min-height: 33px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px;
    font-size: 0.78rem;
    line-height: 1;
    text-align: center;
}

.terminal-top-actions .signal0-admin-pending-button {
    padding: 8px;
    line-height: 1;
}

.terminal-connect-button.is-hidden {
    display: none;
}

.terminal-delayed-button.is-hidden {
    display: none;
}

.terminal-page .profile-panel-actions {
    display: grid;
    gap: 7px;
    justify-content: center;
}

.terminal-page .profile-panel-actions .button {
    width: 172px;
    margin: 0;
    padding: 7px 10px;
    line-height: 1.15;
    text-align: left;
}

.terminal-logs-modal-panel {
    width: min(760px, 92vw);
    max-height: 82vh;
    overflow: hidden;
}

.terminal-log-picker {
    display: grid;
    gap: 16px;
}

.terminal-log-picker-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 14px;
}

.terminal-log-select-wrap {
    position: relative;
    display: grid;
    gap: 8px;
    margin: 0;
}

.terminal-log-select-wrap span {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.terminal-log-picker select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line-strong);
    background:
        linear-gradient(135deg, rgba(71,255,203,0.08), rgba(80,140,255,0.05)),
        #05070a;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    padding: 13px 42px 13px 14px;
    outline: none;
    text-transform: none;
    box-shadow:
        inset 0 0 22px rgba(71,255,203,0.06),
        0 0 0 1px rgba(71,255,203,0.04);
    cursor: pointer;
}

.terminal-log-select-wrap::after {
    content: ">";
    position: absolute;
    right: 15px;
    bottom: 17px;
    color: var(--primary);
    font-weight: 800;
    transform: rotate(90deg);
    pointer-events: none;
    text-shadow: 0 0 10px rgba(71,255,203,0.55);
}

.terminal-log-picker select:focus,
.terminal-log-picker select:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(71,255,203,0.18), 0 0 18px rgba(71,255,203,0.10);
}

.terminal-log-picker optgroup,
.terminal-log-picker option {
    background: #05070a;
    color: var(--text);
}

.terminal-log-picker-preview {
    min-height: 44px;
    border: 1px solid rgba(71,255,203,0.28);
    background: rgba(0, 0, 0, 0.28);
    color: var(--muted);
    padding: 12px 14px;
    box-shadow: inset 0 0 18px rgba(71,255,203,0.04);
}

.terminal-log-picker-actions {
    margin-top: 2px;
}

.terminal-page .terminal-log-picker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

@media (max-width: 720px) {
    .terminal-log-picker-grid {
        grid-template-columns: 1fr;
    }
}

.image-viewer-frame {
    margin-top: 16px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.22);
    padding: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-viewer-frame img {
    display: block;
    max-width: min(100%, 520px);
    max-height: 36vh;
    object-fit: contain;
    border: 1px solid rgba(71,255,203,0.22);
    box-shadow: 0 0 24px rgba(71,255,203,0.12);
    cursor: zoom-in;
}

.image-viewer-actions,
.video-viewer-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-viewer-note,
.video-viewer-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.video-viewer-frame {
    margin-top: 16px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.22);
    padding: 14px;
    box-shadow: 0 0 24px rgba(71,255,203,0.08);
}

.video-viewer-ratio {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid rgba(71,255,203,0.22);
    overflow: hidden;
}

.video-viewer-ratio iframe,
.video-viewer-ratio video {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #000;
}

.install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.install-page .panel {
    width: min(520px, calc(100% - 32px));
    padding: 28px;
}

.install-page h1 {
    margin-top: 0;
}

.install-page label {
    margin-top: 14px;
}

.install-page .install-oauth-choice-hint {
    margin-top: 24px;
}

.install-page .install-oauth-provider-docs {
    margin-bottom: 24px;
}

.install-page .install-form-separator {
    border: 0;
    border-top: 1px solid rgba(71,255,203,0.22);
    margin: 24px 0 18px;
}

.install-page input {
    box-sizing: border-box;
}

.install-page button,
.install-page a.button {
    margin-top: 20px;
}

.install-page .install-footer-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(71,255,203,0.4);
}

.install-page .install-footer-link:hover {
    color: #ffffff;
    border-bottom: 1px solid var(--primary);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid rgba(71,255,203,0.35);
    color: var(--primary);
    background: rgba(71,255,203,0.06);
    font-size: 0.85rem;
}

.badge-off {
    border-color: rgba(255,77,109,0.45);
    color: var(--danger);
    background: rgba(255,77,109,0.06);
}

.badge-link {
    border-color: rgba(255,209,102,0.45);
    color: var(--warning);
    background: rgba(255,209,102,0.06);
}

.badge.bug-status-a_verifier {
    color: var(--text);
    border-color: rgba(221,255,247,0.45);
    background: rgba(221,255,247,0.04);
}

.badge.bug-status-a_traiter {
    color: var(--danger);
    border-color: rgba(255,77,109,0.55);
    background: rgba(255,77,109,0.06);
}

.badge.bug-status-en_cours {
    color: var(--warning);
    border-color: rgba(255,209,102,0.55);
    background: rgba(255,209,102,0.06);
}

.badge.bug-status-resolu {
    color: var(--primary);
    border-color: rgba(71,255,203,0.55);
    background: rgba(71,255,203,0.06);
}

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

.actions form {
    display: inline;
}

.action-button,
.actions button {
    margin: 0;
    padding: 10px 12px;
}

.danger-button {
    border-color: rgba(255,77,109,0.65);
    color: var(--danger);
    background: rgba(255,77,109,0.08);
}

.danger-button:hover {
    background: rgba(255,77,109,0.16);
}

.warning-button {
    border-color: rgba(255,209,102,0.65);
    color: var(--warning);
    background: rgba(255,209,102,0.08);
}

.warning-button:hover {
    background: rgba(255,209,102,0.16);
}

.panel-wide {
    max-width: 900px;
    width: 90%;
    padding: 40px 50px;
}

.panel-wide h2 {
    margin-top: 25px;
    font-size: 1.1em;
    color: #ccc;
    border-left: 2px solid #9146FF;
    padding-left: 10px;
}

.panel-wide p {
    margin: 8px 0 12px;
    color: #aaa;
    line-height: 1.5;
}

.cookie-terminal {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #050505;
    border: 1px solid #222;
    padding: 15px 20px;
    width: 320px;
    font-family: monospace;
    color: #888;
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
    z-index: 9999;
    animation: fadeIn 0.4s ease;
}

.cookie-terminal .terminal-line {
    font-size: 0.8em;
    margin: 4px 0;
}

.cookie-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.cookie-actions button {
    background: none;
    border: 1px solid #333;
    color: #777;
    font-size: 0.75em;
    padding: 4px 8px;
    cursor: pointer;
    font-family: monospace;
}

.cookie-actions button:hover {
    border-color: #9146FF;
    color: #9146FF;
}

.btn-accept:hover {
    color: #4caf50;
    border-color: #4caf50;
}

.btn-decline:hover {
    color: #f44336;
    border-color: #f44336;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.compact-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
}

.compact-audio button {
    all: unset;
    min-width: 42px;
    height: 22px;
    border: 1px solid rgba(71,255,203,0.35);
    background: rgba(71,255,203,0.06);
    color: var(--primary);
    font-size: 0.65rem;
    text-align: center;
    line-height: 22px;
    cursor: pointer;
}

.compact-audio .audio-download {
    all: unset;
    min-width: 90px;
    padding: 0 8px;
    height: 22px;
    border: 1px solid rgba(71,255,203,0.35);
    background: rgba(71,255,203,0.06);
    color: var(--primary);
    font-size: 0.65rem;
    text-align: center;
    line-height: 22px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

.compact-audio input[type="range"] {
    all: unset;
    height: 6px;
    background: rgba(71,255,203,0.18);
    border: 1px solid rgba(71,255,203,0.25);
    cursor: pointer;
}

.compact-audio input.audio-progress[type="range"] {
    width: 120px !important;
}

.compact-audio input.audio-volume[type="range"] {
    width: 55px !important;
}

.compact-audio input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 8px;
    height: 13px;
    background: var(--primary);
}

.compact-audio input[type="range"]::-moz-range-thumb {
    width: 8px;
    height: 13px;
    background: var(--primary);
    border: none;
    border-radius: 0;
}

.panel-audio .panel-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    padding: 12px;
}

.scene-audio-layout {
    width: 100%;
    display: grid;
    gap: 10px;
}

.audio-progress-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.audio-time {
    min-width: 88px;
    color: var(--muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.audio-progress-row input.audio-progress[type="range"] {
    all: unset;
    width: min(260px, 60%) !important;
    height: 6px;
    background: rgba(71,255,203,0.18);
    border: 1px solid rgba(71,255,203,0.25);
    cursor: pointer;
}

.audio-progress-row input.audio-progress[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 8px;
    height: 13px;
    background: var(--primary);
}

.audio-progress-row input.audio-progress[type="range"]::-moz-range-thumb {
    width: 8px;
    height: 13px;
    background: var(--primary);
    border: none;
    border-radius: 0;
}

body.modal-open {
    overflow: hidden;
}

.scene-image-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
    padding: 24px;
}

.scene-image-modal.active {
    display: flex;
}

.scene-image-modal img {
    max-width: 92vw !important;
    max-height: 88vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 40px rgba(0, 255, 170, 0.2);
    background: #000;
}

.scene-image-modal-close {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 1000000;
    cursor: pointer;
}

.scene-command-video,
.terminal iframe,
.terminal video {
    display: block;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 16 / 9;
    margin: 14px 0;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.32);
    box-shadow: 0 0 24px rgba(71,255,203,0.10);
    padding: 8px;
}

.terminal iframe {
    min-height: 320px;
}

.terminal img,
.terminal img.scene-image-thumb,
.terminal-waiting img.scene-image-thumb,
.terminal-typed img.scene-image-thumb {
    display: block !important;
    max-width: 220px !important;
    max-height: 160px !important;
    width: auto !important;
    height: auto !important;
    object-fit: cover !important;
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 18px rgba(0, 255, 170, 0.12);
    margin: 8px 0;
}

@media (max-width: 860px) {
    .command-filter-form {
        grid-template-columns: 1fr;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        border: 1px solid rgba(71,255,203,0.22);
        margin-bottom: 14px;
        padding: 10px;
    }

    td {
        border: none;
        padding: 8px 0;
    }

    td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        margin-bottom: 4px;
    }

    .actions {
        flex-direction: column;
    }

    .actions a,
    .actions button {
        width: 100%;
        text-align: left;
        box-sizing: border-box;
    }
}

@media (max-width: 1020px) {
    .scene-grid {
        grid-template-columns: 220px 1fr;
    }

    .right-col {
        grid-column: 1 / -1;
    }
}

@media (max-width: 800px) {
    .grid,
    .scene-grid {
        grid-template-columns: 1fr;
    }

    .login-page {
        align-items: flex-start;
        padding-top: 40px;
    }

}

@media (max-width: 720px) {
    .app {
        width: min(100% - 18px, 1320px);
        padding-top: 10px;
    }

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

    .status {
        justify-content: flex-start;
    }

    .input-row {
        flex-direction: column;
    }
}
