
body.light-theme {
    --bg-dark:      #f6f8fa;
    --bg-mid:       #eaeef2;
    --bg-light:     #fff;
    --bg-input:     #fff;
    --border:       #d0d7de;
    --accent:       #1a7f37;
    --accent-dim:   #b6e3b6;
    --text-main:    #24292f;
    --text-dim:     #57606a;
    --text-code:    #1b1f23;
    --user-bg:      #e6f1fa;
    --user-border:  #1d4ed8;
    --ai-bg:        #c2ebdb;
    --ai-border:    #d0d7de;
    --error:        #d1242f;
    --radius:       10px;
    --header-h:     60px;
    --input-h:      90px;
    --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono:    'Cascadia Code', 'Consolas', 'Courier New', monospace;
}
/* ===========================
   Genesis Script Generator UI
   Dark theme
   =========================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark:      #0d1117;
    --bg-mid:       #161b22;
    --bg-light:     #21262d;
    --bg-input:     #0d1117;
    --border:       #30363d;
    --accent:       #39ff14;
    --accent-dim:   #2db30e;
    --text-main:    #e6edf3;
    --text-dim:     #8b949e;
    --text-code:    #f0f6fc;
    --user-bg:      #1f3a5f;
    --user-border:  #1d4ed8;
    --ai-bg:        #161b22;
    --ai-border:    #30363d;
    --error:        #f85149;
    --radius:       10px;
    --header-h:     60px;
    --input-h:      90px;
    --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono:    'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font);
    font-size: 14px;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ---- HEADER ---- */
#header {
    height: var(--header-h);
    background: var(--bg-mid);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
#header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--accent) 60%, transparent 100%);
    opacity: 0.6;
    pointer-events: none;
}

#header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    display: block;
}

#title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

#version-badge {
    font-size: 10px;
    font-weight: 700;
    color: #0d1117;
    background: var(--accent);
    padding: 1px 6px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

#subtitle {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

#model-name {
    color: var(--accent);
    font-weight: 600;
}

#header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Status dot */
#status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-checking { background: #f0b429; animation: pulse 1.5s infinite; }
.status-ok       { background: var(--accent); }
.status-error    { background: var(--error); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

#status-text {
    font-size: 12px;
    color: var(--text-dim);
    min-width: 80px;
}

#btn-clear {
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}
#btn-clear:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ---- CHAT WINDOW ---- */
#chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    scroll-behavior: smooth;
}

#messages {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---- MESSAGES ---- */
.msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-msg .msg-avatar {
    background: var(--accent);
    color: #000;
}

.user-msg {
    flex-direction: row-reverse;
}

.user-msg .msg-avatar {
    background: var(--user-border);
    color: #fff;
}

.msg-content {
    max-width: calc(100% - 50px);
}

.msg-text {
    padding: 12px 16px;
    border-radius: var(--radius);
    line-height: 1.65;
    word-break: break-word;
}

.ai-msg .msg-text {
    background: var(--ai-bg);
    border: 1px solid var(--ai-border);
    border-top-left-radius: 2px;
}

.user-msg .msg-text {
    background: var(--user-bg);
    border: 1px solid var(--user-border);
    border-top-right-radius: 2px;
    color: #cde4ff;
}
body.light-theme .user-msg .msg-text {
    color: #1a237e;
}

/* Typography inside messages */
.msg-text p  { margin-bottom: 10px; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text ul, .msg-text ol { padding-left: 20px; margin-bottom: 10px; }
.msg-text li { margin-bottom: 4px; }
.msg-text strong { color: #fff; }
body.light-theme .msg-text strong {
    color: var(--accent);
}
.msg-text em { color: var(--text-dim); font-style: italic; }

.example-bubbles {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.example-bubble {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
    line-height: 1.4;
}
.example-bubble:hover {
    background: var(--accent);
    color: #000;
}

/* Code blocks */
.code-block-wrap {
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.code-block-header {
    background: #1c2128;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

.code-block-header span {
    font-family: var(--font-mono);
    color: var(--accent);
}

.code-block-actions {
    display: flex;
    gap: 6px;
}

.btn-code {
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
}
.btn-code:hover {
    background: var(--border);
    color: var(--text-main);
}
.btn-code.copied {
    border-color: var(--accent);
    color: var(--accent);
}

.code-block-wrap pre {
    margin: 0;
    max-height: 500px;
    overflow-y: auto;
}

.code-block-wrap pre code {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    padding: 14px 16px !important;
    display: block;
}

/* Inline code */
.msg-text code:not(.hljs) {
    background: rgba(110, 118, 129, 0.2);
    color: #f0f6fc;
}
body.light-theme .msg-text code:not(.hljs) {
    background: rgba(110, 118, 129, 0.12);
    color: #1b1f23;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Streaming cursor */
.streaming-cursor::after {
    content: '▋';
    color: var(--accent);
    animation: blink 0.8s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Thinking indicator */
.thinking-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin: 0 2px;
    animation: bounce 1.2s infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%            { transform: translateY(-6px); opacity: 1; }
}

/* ---- INPUT BAR ---- */
#input-bar {
    background: var(--bg-mid);
    border-top: 1px solid var(--border);
    padding: 12px 16px 8px;
    flex-shrink: 0;
}

#chat-mode-switch {
    max-width: 860px;
    margin: 0 auto 8px;
    display: flex;
    gap: 8px;
}

.fab-meta {
    max-width: 860px;
    margin: 0 auto 8px;
    color: var(--text-dim);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(57, 255, 20, 0.05);
}

.fab-upload-row {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

#fab-image-input {
    display: none;
}

.fab-upload-btn {
    background: var(--bg-light);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.fab-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.fab-upload-btn.has-image {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-size: 20px;
    font-weight: 700;
}

.fab-upload-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.fab-upload-btn.has-image:hover {
    background: var(--accent-dim);
    color: #000;
    border-color: var(--accent-dim);
}

.fab-image-name {
    display: none;
}

.mode-btn {
    background: var(--bg-light);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.mode-btn:hover {
    color: var(--text-main);
    border-color: var(--accent);
}

.mode-btn.active {
    background: rgba(57,255,20,0.12);
    color: var(--accent);
    border-color: rgba(57,255,20,0.45);
}

#input-wrap {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#user-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 14px;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 160px;
    transition: border-color 0.15s;
}

#user-input:focus {
    border-color: var(--accent);
}
#user-input::placeholder {
    color: var(--text-dim);
}
#user-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#send-btn {
    background: var(--accent);
    border: none;
    color: #000;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, opacity 0.15s, width 0.15s;
}
#send-btn:hover  { background: var(--accent-dim); }
#send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#send-btn.stop-mode {
    width: 72px;
    background: var(--error);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
}

#send-btn.stop-mode:hover {
    background: #da3633;
}

#input-hint {
    max-width: 860px;
    margin: 4px auto 0;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    padding: 0 2px;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ---- HEADER USER / LOGOUT / ADMIN ---- */
.header-user {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(57,255,20,0.08);
    border-radius: 6px;
    border: 1px solid rgba(57,255,20,0.2);
}

.header-link {
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    transition: all 0.15s;
}
.header-link:hover { color: var(--text-main); border-color: var(--accent); }
.admin-link:hover  { color: var(--accent); }
.logout-link { color: rgba(255,90,90,0.75); border-color: rgba(255,90,90,0.25); }
.logout-link:hover { color: var(--error); border-color: var(--error); }

.mode-switcher {
    display: flex;
    align-items: center;
}

.mode-switch-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.mode-switch-btn:hover {
    color: var(--text-main);
    border-color: var(--accent);
    background: rgba(57, 255, 20, 0.05);
}

.mode-switch-btn-locked,
.mode-switch-btn-locked:hover {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border);
    background: var(--bg-light);
    color: var(--text-dim);
}

.role-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 9px;
    letter-spacing: 0.3px;
    border: 1px solid var(--border);
    text-transform: uppercase;
}

.role-chip-admin {
    color: #8ad7ff;
    border-color: rgba(138,215,255,0.45);
    background: rgba(138,215,255,0.08);
}

.role-chip-super {
    color: #ffd24f;
    border-color: rgba(255,210,79,0.55);
    background: rgba(255,210,79,0.1);
}

/* ---- LOGIN PAGE ---- */
body.auth-body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--bg-dark);
}

#hex-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    flex-direction: row;
}

/* --- Left: form panel --- */
#login-panel {
    width: 42%;
    min-width: 360px;
    max-width: 480px;
    flex-shrink: 0;
    background: rgba(13, 17, 23, 0.30);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
    position: relative;
    z-index: 2;
}

#login-form-inner {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@keyframes sep-blink {
    0%, 100% { opacity: 1; box-shadow: 0 0 18px rgba(57,255,20,0.55), 0 0 36px rgba(57,255,20,0.2); }
    50%       { opacity: 0.1; box-shadow: none; }
}

#login-panel::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 10%;
    height: 80%;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(57,255,20,0.1) 0%, rgba(57,255,20,0.95) 50%, rgba(57,255,20,0.1) 100%);
    box-shadow: 0 0 18px rgba(57,255,20,0.55), 0 0 36px rgba(57,255,20,0.2);
    animation: sep-blink 2.2s ease-in-out infinite;
    z-index: 3;
}

#login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#login-logo-main {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 18px;
}

#login-app-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

#login-version {
    font-size: 12px;
    color: var(--text-dim);
}

#login-form-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-error {
    width: 100%;
    background: rgba(248,81,73,0.12);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 8px;
    text-align: center;
    box-sizing: border-box;
}

#login-form-wrap .form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

#login-form-wrap label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
}

#login-form-wrap input[type="text"],
#login-form-wrap input[type="password"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 14px;
    outline: none;
    font-family: var(--font);
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}
#login-form-wrap input:focus { border-color: var(--accent); }

.btn-login {
    width: 100%;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s;
}
.btn-login:hover { background: var(--accent-dim); }

.login-divider {
    width: 100%; display: flex; align-items: center;
    gap: 10px; margin: 12px 0 8px;
    color: var(--text-dim); font-size: 12px;
}
.login-divider::before, .login-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-ms-login {
    width: 100%; display: flex; align-items: center;
    justify-content: center; gap: 10px;
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text-main); border-radius: 7px; padding: 9px 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}
.btn-ms-login:hover { border-color: var(--accent); background: var(--bg-mid); }

/* --- Right: carousel panel --- */
#login-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(13, 17, 23, 0.22);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    overflow: hidden;
}

#hero-carousel {
    width: 100%;
    max-width: 520px;
}

.hero-carousel-card {
    background: rgba(22, 27, 34, 0.38);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-top: 2px solid rgba(57,255,20,0.5);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.hero-carousel-card:hover {
    border-color: rgba(57,255,20,0.6);
    border-top-color: var(--accent);
    box-shadow: 0 0 32px rgba(57,255,20,0.1), 0 16px 48px rgba(0,0,0,0.4);
    transform: translateY(-4px);
}

#hero-slides-wrap {
    padding: 44px 44px 36px;
    display: grid;
    grid-template-areas: "slide";
    min-height: 370px;
}

.hero-slide {
    grid-area: slide;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-slide-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    align-self: flex-start;
}

.hero-badge-script {
    background: rgba(57,255,20,0.1);
    border: 1px solid rgba(57,255,20,0.35);
    color: var(--accent);
}

.hero-badge-fab {
    background: rgba(78,156,245,0.1);
    border: 1px solid rgba(78,156,245,0.35);
    color: #4e9cf5;
}

.hero-slide-feat-icon {
    font-size: 46px;
    line-height: 1;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 10px rgba(255,149,0,0.45));
}

.hero-slide-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #ffb347 0%, #ff8c00 60%, #ff6a00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    text-shadow: none;
}

.hero-slide-desc {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.65;
}

.hero-slide-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.hero-slide-list li {
    font-size: 13px;
    color: var(--text-dim);
    padding-left: 18px;
    position: relative;
    line-height: 1.4;
}

.hero-slide-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

.hero-slide-list-fab li::before { color: #4e9cf5; }

/* Duo slide: two items stacked with divider */
.hero-slide-duo {
    gap: 0;
}

.hero-duo-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-duo-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
    opacity: 0.6;
}

.hero-slide-duo .hero-slide-feat-icon {
    font-size: 30px;
    filter: drop-shadow(0 0 8px rgba(255,149,0,0.35));
}

.hero-slide-duo .hero-slide-title {
    font-size: 18px;
}

.hero-slide-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: -4px;
}

.hero-slide-desc-em {
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    font-style: italic;
    opacity: 0.9;
}

/* FAQ slide */
.hero-slide-faq {
    gap: 12px;
}

.hero-faq-list {
    display: flex;
    flex-direction: column;
}

.hero-faq-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 0;
}

.hero-faq-divider {
    height: 1px;
    background: var(--border);
    opacity: 0.5;
}

.hero-faq-q {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.hero-faq-a {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.55;
}

.hero-carousel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px 18px;
    border-top: 1px solid var(--border);
}

.hero-nav-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.hero-nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

#hero-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.hero-dot.active {
    background: var(--accent);
    transform: scale(1.4);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body.auth-body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    #auth-shell {
        flex-direction: column;
        height: auto;
        max-width: 100%;
    }

    #login-panel::after { display: none; }

    #login-panel {
        width: 100%;
        min-width: unset;
        max-width: 100%;
        border-bottom: 1px solid var(--border);
        padding: 32px 28px 36px;
        align-items: center;
        overflow-y: visible;
    }

    #login-logo-main { max-width: 180px; }
    #login-brand { margin-bottom: 4px; }
    #login-form-inner { max-width: 100%; }

    #login-hero {
        padding: 28px 20px 40px;
        overflow: visible;
        align-items: flex-start;
    }

    #hero-carousel { max-width: 100%; }

    #hero-slides-wrap {
        padding: 24px 24px 20px;
        min-height: 260px;
    }
}

@media (max-width: 480px) {
    #login-panel { padding: 24px 20px 28px; }
    #login-logo-main { max-width: 140px; }
    #hero-slides-wrap { min-height: 280px; padding: 20px 20px 16px; }
}

@media (max-width: 360px) {
    #login-panel { padding: 20px 16px 24px; }
    #login-logo-main { max-width: 120px; }
}

/* Compact header behavior for narrow screens (post-login pages) */
@media (max-width: 900px) {
    #logo {
        width: 36px;
        height: 36px;
    }

    #header {
        height: auto;
        min-height: var(--header-h);
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 6px;
    }

    #header-left {
        flex: 1 1 auto;
        min-width: 0;
        gap: 8px;
    }

    #title {
        font-size: 14px;
        line-height: 1.2;
    }

    #subtitle {
        font-size: 10px;
    }

    #header-right {
        width: 100%;
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: wrap;
    }

    #status-text {
        min-width: 0;
        font-size: 11px;
    }

    .header-link,
    #btn-clear,
    .role-chip,
    .header-user {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* ---- ADMIN SETTINGS PAGE ---- */
#admin-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 20px 24px;
    overflow-y: auto;
    gap: 16px;
}

#admin-card {
    background: var(--bg-mid);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 36px;
    width: 100%;
    max-width: 860px;
}

.admin-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-mode-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(57,255,20,0.12);
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    white-space: nowrap;
    margin-top: 3px;
}

.admin-mode-tag-fab {
    background: rgba(88,166,255,0.12);
    color: #58a6ff;
    border-color: rgba(88,166,255,0.3);
}

.admin-section-divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0 22px;
}

.admin-fields-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.admin-fields-row .admin-field {
    flex: 1;
    min-width: 160px;
    margin-bottom: 0;
}

.admin-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
}

.admin-select:focus { border-color: var(--accent); }

.admin-action-bar {
    display: flex;
    gap: 14px;
    justify-content: center;
    width: 100%;
    max-width: 860px;
    padding: 8px 0 16px;
}

.admin-action-bar button {
    padding: 11px 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
    min-width: 160px;
}

.admin-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.admin-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 0;
    margin-top: 4px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 22px;
}

.admin-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.field-hint {
    font-weight: 400;
    color: var(--text-dim);
    font-size: 11px;
}

.admin-field input[type="number"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 14px;
    outline: none;
    font-family: var(--font-mono);
    width: 180px;
    transition: border-color 0.15s;
}
.admin-field input[type="number"]:focus { border-color: var(--accent); }

.admin-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.admin-actions button {
    padding: 9px 22px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

#btn-save-settings {
    background: var(--accent);
    color: #000;
}
#btn-save-settings:hover { background: var(--accent-dim); }

#btn-reset-settings {
    background: var(--bg-light);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
#btn-reset-settings:hover { color: var(--text-main); border-color: var(--text-dim); }

.admin-save-msg {
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 12px;
    margin-bottom: 20px;
    font-weight: 600;
}
.msg-ok    { background: rgba(57,255,20,0.1);  border: 1px solid var(--accent); color: var(--accent); }
.msg-error { background: rgba(248,81,73,0.1);  border: 1px solid var(--error);  color: var(--error); }

/* ---- ACCOUNT SETTINGS ---- */
.account-section {
    margin-bottom: 8px;
}

.account-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: start;
}

.account-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 20px;
}

.account-nav-btn {
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.account-nav-btn:hover {
    border-color: var(--accent);
    color: var(--text-main);
}

.account-nav-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(57,255,20,0.08);
}

.account-panels {
    min-width: 0;
}

.account-panel {
    display: none;
}

.account-panel.active {
    display: block;
}

.account-subtitle {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 14px;
}

.account-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.small-note {
    font-size: 11px;
    color: var(--text-dim);
}

.msg-text-ok {
    color: var(--accent);
}

.msg-text-error {
    color: var(--error);
}

.admin-pill {
    display: inline-block;
    background: rgba(57,255,20,0.12);
    border: 1px solid rgba(57,255,20,0.35);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
    margin-bottom: 16px;
}

.admin-pill.super {
    color: #ffd24f;
    border-color: rgba(255,210,79,0.55);
    background: rgba(255,210,79,0.1);
}

#admin-card input[type="text"],
#admin-card input[type="password"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 14px;
    outline: none;
    font-family: var(--font);
    width: 100%;
    max-width: 360px;
    transition: border-color 0.15s;
}

#admin-card input[type="text"]:focus,
#admin-card input[type="password"]:focus {
    border-color: var(--accent);
}

#admin-card select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 14px;
    outline: none;
    font-family: var(--font);
    width: 180px;
}

#admin-card select.admin-select { width: 30%; }

#admin-card select:focus {
    border-color: var(--accent);
}

.users-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.users-table-wide {
    width: 100%;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

.users-table th,
.users-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    word-break: break-word;
}

.users-table th {
    background: #111720;
    color: var(--text-dim);
    font-weight: 700;
}

.users-table tr:last-child td {
    border-bottom: none;
}

.role-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.role-admin {
    color: var(--accent);
    border-color: rgba(57,255,20,0.45);
    background: rgba(57,255,20,0.08);
}

.role-user {
    color: #86b7ff;
    border-color: rgba(134,183,255,0.45);
    background: rgba(134,183,255,0.08);
}

.self-tag {
    color: var(--text-dim);
    font-size: 11px;
    margin-left: 4px;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff00;
    box-shadow: 0 0 4px rgba(0, 255, 0, 0.8);
    margin-right: 6px;
    vertical-align: middle;
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 4px rgba(0, 255, 0, 0.8);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 8px rgba(0, 255, 0, 1);
    }
}

.btn-delete-user {
    background: rgba(248,81,73,0.12);
    color: var(--error);
    border: 1px solid rgba(248,81,73,0.5);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-delete-user:hover {
    background: rgba(248,81,73,0.2);
}

.role-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
    min-width: 110px;
}

#admin-card.account-card-wide {
    max-width: 1400px;
}

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

.script-access-toggle input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.script-access-label {
    font-size: 12px;
    color: var(--text-muted);
}

.role-select:focus {
    outline: none;
    border-color: var(--accent);
}

@media (max-width: 900px) {
    #admin-card,
    .account-card-wide {
        max-width: 560px;
    }

    .account-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .account-nav {
        position: static;
    }

    .account-nav-btn {
        width: 100%;
    }
}

/* ---- Like / Dislike feedback bar ---- */
.feedback-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.feedback-label {
    font-size: 0.82em;
    color: #999;
}
.feedback-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.feedback-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}
body.light-theme .feedback-buttons {
    border-top-color: rgba(0,0,0,0.1);
}
body.light-theme .feedback-btn {
    border-color: rgba(0,0,0,0.2);
}
body.light-theme .feedback-btn:hover {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.35);
}
.post-teams-btn {
    background: rgba(255,255,255,0.07);
    color: #ffd24f;
    font-size: 0.85em;
    padding: 3px 12px;
}
.post-teams-btn:hover { background: rgba(255,255,255,0.15); }
.continue-btn {
    font-size: 0.85em;
    padding: 3px 12px;
    color: #aaa;
}
.correction-form { width: 100%; }
.correction-label {
    font-size: 0.82em;
    color: #999;
    display: block;
    margin-bottom: 4px;
}
.correction-textarea {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: inherit;
    padding: 6px 8px;
    font-size: 0.9em;
    resize: vertical;
    box-sizing: border-box;
}
.correction-actions { display: flex; gap: 8px; margin-top: 6px; }
.correction-submit-btn { background: rgba(80,180,80,0.2); border-color: rgba(80,180,80,0.4); }
.correction-submit-btn:hover { background: rgba(80,180,80,0.35); }
body.light-theme .post-teams-btn { background: rgba(0,0,0,0.05); color: inherit; }
body.light-theme .post-teams-btn:hover { background: rgba(0,0,0,0.1); }
body.light-theme .continue-btn { color: #888; }
body.light-theme .correction-textarea {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.2);
    color: inherit;
}

/* ========================
   GUI Improvements v1.20
   ======================== */

/* ---- Utility button classes ---- */
.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 9px 22px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary:hover    { background: var(--accent-dim); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 9px 22px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-secondary:hover { color: var(--text-main); border-color: var(--text-dim); }

/* ---- Feedback button groups ---- */
.feedback-group         { display: flex; align-items: center; gap: 6px; }
.feedback-group-divider {
    width: 1px; height: 20px; flex-shrink: 0;
    background: rgba(255,255,255,0.2);
}
body.light-theme .feedback-group-divider { background: rgba(0,0,0,0.15); }

/* ---- Code block header accent ---- */
.code-block-header { border-left: 3px solid var(--accent); }

/* ---- Mode-select card min-height ---- */
.mode-card-inner { min-height: 280px; }

/* ---- History panel container ---- */
.history-panel-container {
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--bg-mid);
}

/* ---- History message cards ---- */
.history-msg-card {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.history-msg-card:last-child { border-bottom: none; }
.history-role-user      { background: rgba(31,58,95,0.25); }
.history-role-assistant { background: var(--bg-light); }
body.light-theme .history-role-user      { background: rgba(230,241,250,0.6); }
body.light-theme .history-role-assistant { background: var(--bg-mid); }

.history-msg-meta {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; margin-bottom: 5px;
}
.history-role-badge {
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
}
.history-role-user .history-role-badge {
    color: #8ad7ff; border: 1px solid rgba(138,215,255,0.4);
    background: rgba(138,215,255,0.08);
}
.history-role-assistant .history-role-badge {
    color: var(--accent); border: 1px solid rgba(57,255,20,0.4);
    background: rgba(57,255,20,0.08);
}

.history-mode-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    padding: 2px 7px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-dim);
}
.history-mode-script { background: rgba(31,58,95,0.4); border-color: rgba(31,100,200,0.4); color: #7ab3ff; }
.history-mode-fab    { background: rgba(26,58,31,0.4); border-color: rgba(57,255,20,0.25); color: var(--accent); }

.history-timestamp   { font-size: 11px; color: var(--text-dim); margin-left: auto; }
.history-user-prefix { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.history-msg-body    {
    font-size: 13px; color: var(--text-main);
    line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.history-empty { padding: 20px; color: var(--text-dim); text-align: center; font-size: 13px; }

/* ---- Audit event cards ---- */
.audit-status-ok      { color: var(--accent); }
.audit-status-blocked { color: #f0a500; }
.audit-status-error   { color: var(--error); }
.audit-event-name     { font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.audit-event-details  { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

/* ---- History search input ---- */
.history-search-wrap { margin-bottom: 10px; }
.history-search-input {
    width: 100%; max-width: 360px;
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text-main); padding: 8px 12px; border-radius: 7px;
    font-size: 13px; outline: none; font-family: var(--font);
    transition: border-color 0.15s;
}
.history-search-input:focus { border-color: var(--accent); }
.history-search-input::placeholder { color: var(--text-dim); }

/* ---- Toast notifications ---- */
#toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
    background: var(--bg-mid); border: 1px solid var(--border);
    color: var(--text-main); padding: 12px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    animation: toastIn 0.2s ease; pointer-events: auto; max-width: 320px;
}
.toast-ok    { border-color: var(--accent); color: var(--accent); background: rgba(57,255,20,0.08); }
.toast-error { border-color: var(--error);  color: var(--error);  background: rgba(248,81,73,0.08); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Admin fields grid (overrides flex) ---- */
.admin-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    flex-wrap: unset;
}
.admin-fields-row .admin-field { flex: unset; min-width: 0; margin-bottom: 0; }
.admin-fields-row .admin-field input[type="number"] { width: 100%; }
@media (max-width: 640px) {
    .admin-fields-row { grid-template-columns: 1fr; }
}

/* ---- Active nav tab: stronger left border ---- */
.account-nav-btn.active {
    border-left-width: 3px;
    padding-left: 10px;
}

/* ---- User list table: hide Display Name on mobile ---- */
@media (max-width: 768px) {
    .col-display-name { display: none; }
}

/* ---- Mobile account page improvements ---- */
@media (max-width: 600px) {
    #admin-card {
        padding: 20px 14px;
    }

    /* Nav: 2-column grid so all buttons visible, none clipped */
    .account-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .account-nav-btn {
        flex: 1 1 calc(50% - 3px);
        width: auto;
        white-space: normal;
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Table: force min-width so wrap scrolls horizontally */
    .users-table {
        min-width: 360px;
    }

    .users-table th,
    .users-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .role-select {
        min-width: 0;
        width: 100%;
        font-size: 11px;
        padding: 4px 6px;
    }

    /* Column widths: username auto, role takes remaining space, actions shrink-wrap */
    .users-table th:nth-child(1),
    .users-table td:nth-child(1) { width: 30%; }

    .users-table th:nth-child(2),
    .users-table td:nth-child(2) { width: 45%; }

    .users-table th:nth-child(3),
    .users-table td:nth-child(3) { width: 25%; white-space: nowrap; }
}

/* ---- Stream error badge ---- */
.stream-error-badge {
    margin-top: 8px; padding: 6px 10px; border-radius: 6px;
    background: rgba(248,81,73,0.1); border: 1px solid rgba(248,81,73,0.4);
    color: var(--error); font-size: 12px; font-weight: 600;
}

/* ---- Mobile textarea max-height ---- */
@media (max-width: 600px) {
    #user-input { max-height: 120px; }
}

/* ---- Button loading state ---- */
.btn-loading { opacity: 0.65; cursor: not-allowed; pointer-events: none; }

/* ---- Suppress browser native password reveal button (Edge/IE) ---- */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }

/* ---- Password visibility toggle ---- */
.pw-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 360px;
}
.pw-wrap input[type="password"],
.pw-wrap input[type="text"] {
    max-width: none !important;
    width: 100% !important;
    padding-right: 38px !important;
}
.pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 36px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s;
    flex-shrink: 0;
}
.pw-toggle:hover { color: #444; }

/* Login page pw-wrap fills form-group width */
.form-group .pw-wrap { max-width: none; }

/* ---- Switch Workspace Modal ---- */
.ws-modal-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
}
.ws-modal {
    background: var(--bg-mid);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 40px 32px;
    max-width: 380px; width: 90%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(57,255,20,0.08);
    animation: wsModalIn 0.18s ease;
}
@keyframes wsModalIn {
    from { opacity: 0; transform: scale(0.94) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ws-modal-icon {
    font-size: 36px; margin-bottom: 12px; color: var(--accent);
    line-height: 1;
}
.ws-modal-title {
    font-size: 17px; font-weight: 700; color: var(--text-main);
    margin: 0 0 10px;
}
.ws-modal-body {
    font-size: 13px; color: var(--text-dim); margin: 0 0 28px; line-height: 1.5;
}
.ws-modal-actions {
    display: flex; gap: 12px; justify-content: center;
}
.ws-modal-actions .btn-primary,
.ws-modal-actions .btn-secondary {
    min-width: 100px; justify-content: center;
}

/* ---- Header Refresh v1.20.1 ---- */

/* Light theme header shadow override */
body.light-theme #header { box-shadow: 0 2px 12px rgba(0,0,0,0.12); }

/* Logo hover glow */
#logo { transition: filter 0.2s; }
#logo:hover { filter: drop-shadow(0 0 10px rgba(57,255,20,0.5)); }

/* Status badge pill */
.status-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
}

/* Theme toggle button */
.theme-toggle-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    padding: 5px 8px;
    transition: border-color 0.15s, background 0.15s;
    color: var(--text-main);
}
.theme-toggle-btn:hover { border-color: var(--accent); background: rgba(57,255,20,0.07); }

/* Nav divider in header-right */
.header-nav-divider {
    width: 1px; height: 18px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Subtitle accent on secondary pages */
#subtitle.subtitle-context {
    color: var(--accent);
    opacity: 0.75;
}
