h1, h2, h3, .logo, .section-title, .modal-title, .stat-value, .card-name { font-family: var(--font-display); letter-spacing: -.03em; font-weight: 800; }

.landing-page, .loader-overlay, .login-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; background: transparent; }
.login-box { width: min(100%, 420px); padding: 40px 36px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(229, 231, 235, 0.95); border-radius: 28px; box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.08), 0 10px 25px -5px rgba(0, 0, 0, 0.04); animation: enter .25s ease both; text-align: center; }
.landing-container { width: min(100%, 420px); padding: 40px 36px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(229, 231, 235, 0.95); border-radius: 28px; box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.08), 0 10px 25px -5px rgba(0, 0, 0, 0.04); animation: enter .25s ease both; text-align: center; }
.landing-meta { margin-bottom: 14px; color: var(--accent); font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.landing-header-row { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.landing-title { font-size: 32px; font-weight: 900; line-height: 1.1; color: #111827; }
.landing-tagline { margin-bottom: 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.landing-actions { display: flex; gap: 12px; justify-content: center; }
.landing-btn, .landing-btn-sec { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 24px; border-radius: 9999px; font-size: 13px; font-weight: 700; cursor: pointer; transition: var(--transition); }
.landing-btn { color: #ffffff; background: #111827; border: 1px solid #111827; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1); }
.landing-btn-sec { color: var(--ink); background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); }
.landing-btn:hover { background: #000000; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16); }
.landing-btn-sec:hover { background: #ffffff; border-color: var(--line-strong); transform: translateY(-2px); }

.loader-overlay { display: none; flex-direction: column; text-align: center; }
.loader-overlay.active { display: flex; }
.loader-content { display: grid; justify-items: center; }
.loader-wordmark { margin-bottom: 13px; font-size: 26px; letter-spacing: -.04em; color: #111827; }
.loader-msg { color: var(--muted); font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }

.login-box h1 { margin-bottom: 4px; font-size: 28px; }
.login-box p { margin-bottom: 24px; color: var(--muted); font-size: 13px; font-weight: 500; }
.login-box input, .form-input { display: block; width: 100%; min-height: 42px; padding: 0 16px; color: var(--ink); background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); border-radius: 14px; outline: 0; font-size: 13px; transition: var(--transition); }
.login-box input { margin-top: 10px; }
.login-box input:focus, .form-input:focus { border-color: #111827; background: #ffffff; box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06); }
input::placeholder, textarea::placeholder { color: var(--quiet); }
.login-box > button:not(.btn-discord) { width: 100%; min-height: 42px; margin-top: 16px; color: #ffffff; background: #111827; border: 1px solid #111827; border-radius: 9999px; font-size: 13px; font-weight: 700; cursor: pointer; transition: var(--transition); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1); }
.login-box > button:not(.btn-discord):hover { background: #000000; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16); }

.login-error { margin-top: 12px; padding: 10px 14px; color: var(--danger); background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 12px; text-align: left; font-size: 12px; }
body.dark-mode .login-error { background: #351f1d; border-color: #70403a; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--quiet); font: 700 10px var(--mono); }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-discord { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 42px; color: var(--ink); background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); border-radius: 9999px; cursor: pointer; font-size: 12.5px; font-weight: 700; transition: var(--transition); }
.btn-discord:hover { border-color: var(--line-strong); background: #ffffff; transform: translateY(-1px); }
.btn-discord svg { width: 15px; height: 15px; }

.app { min-height: 100vh; }
.dashboard-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); background: transparent; }
.dashboard-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 28px 18px; color: var(--ink); background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-right: 1px solid var(--line); z-index: 100; }
.sidebar-brand { padding: 4px 8px 24px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.sidebar-brand-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.2; }
.sidebar-section-label { margin: 16px 10px 6px; color: var(--muted); font: 700 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; }

.nav { display: flex; gap: 6px; }
.dashboard-nav { flex-direction: column; gap: 4px; }
.nav button, .filter-tab { padding: 8px 16px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 9999px; cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: var(--transition); }
.dashboard-nav button { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 14px; color: var(--muted); border-color: transparent; text-align: left; border-radius: 12px; transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
.nav button:hover, .filter-tab:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
.dashboard-nav button:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
body.dark-mode .dashboard-nav button:hover { color: #f8fafc; background: rgba(255, 255, 255, 0.06); }
.nav button.active, .filter-tab.active { color: #ffffff; background: #111827; border-color: #111827; }
.dashboard-nav button.active { color: #ffffff; background: #111827; border-color: #111827; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.dashboard-nav button svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.8; }
.dashboard-nav button.active svg { opacity: 1; }

.sidebar-tool-link, .sidebar-tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 14px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}
.sidebar-tool-link:hover, .sidebar-tool-btn:hover {
    color: var(--ink);
    background: rgba(0, 0, 0, 0.04);
}
body.dark-mode .sidebar-tool-link:hover, body.dark-mode .sidebar-tool-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}
.sidebar-tool-link svg, .sidebar-tool-btn svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.8; }
.sidebar-tool-badge {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}
body.dark-mode .sidebar-tool-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}
.nav-index { color: currentColor; font: 700 8px var(--mono); opacity: .62; }

.dashboard-workspace { min-width: 0; }
.warning-banner {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    background: rgba(254, 243, 199, 0.88);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    color: #92400e;
    border-bottom: 1px solid rgba(253, 230, 138, 0.85);
    padding: 4px 14px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.3;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

body.dark-mode .warning-banner {
    background: rgba(36, 24, 4, 0.85);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border-bottom-color: rgba(69, 48, 3, 0.9);
    color: #fbbf24;
}

.warning-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.warning-banner-inner strong {
    font-weight: 800;
    color: #b45309;
    letter-spacing: 0.04em;
    margin-right: 6px;
}

body.dark-mode .warning-banner-inner strong {
    color: #f59e0b;
}

.workspace-header { position: sticky; top: 38px; z-index: 100; display: flex; height: 56px; min-height: 56px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 16px 0 22px; margin: 12px clamp(16px, 2.5vw, 36px) 20px; background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%); border: 1px solid rgba(229, 231, 235, 0.85); border-radius: 9999px; box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02); transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.workspace-header:hover { border-color: rgba(209, 213, 219, 0.95); box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03); background: rgba(255, 255, 255, 0.9); }
body.dark-mode .workspace-header { background: rgba(15, 17, 23, 0.82); border-color: rgba(255, 255, 255, 0.08); }
body.dark-mode .workspace-header:hover { background: rgba(20, 24, 33, 0.9); border-color: rgba(255, 255, 255, 0.15); }
.workspace-brand-link { text-decoration: none; display: inline-flex; align-items: baseline; gap: 8px; flex: 0 0 auto; }
.workspace-brand-text { font-family: 'Outfit', sans-serif; font-size: 19px; font-weight: 900; letter-spacing: -0.02em; color: #111827; text-transform: uppercase; }
body.dark-mode .workspace-brand-text { color: #f8fafc; }
.workspace-brand-sub { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; color: #6b7280; letter-spacing: 0.02em; }
body.dark-mode .workspace-brand-sub { color: #94a3b8; }
.workspace-context { display: flex; min-width: 0; flex-direction: column; line-height: 1.2; }
.workspace-context strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.workspace-kicker, .view-eyebrow { display: none; }
.user-profile { display: flex; min-width: 0; max-width: 100%; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; }
.user-profile > * { flex: 0 0 auto; }
.user-profile img { width: 28px; height: 28px; flex: 0 0 auto; object-fit: cover; border: 1px solid var(--line); border-radius: 50%; }
.user-profile > span { max-width: min(180px, 22vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 12.5px; color: var(--ink); }
.workspace-header .btn-fill {
    background: #111827;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.workspace-header .btn-fill:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
body.dark-mode .workspace-header .btn-fill {
    background: #ffffff;
    color: #000000;
}
body.dark-mode .workspace-header .btn-fill:hover {
    background: #f1f5f9;
}

.workspace-header .user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px 3px 4px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--line);
    border-radius: 9999px;
}
.workspace-header .user-pill img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.workspace-header .user-pill span {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.02em;
}
body.dark-mode .workspace-header .user-pill {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.workspace-header .logout-btn {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 12px;
    border-radius: 9999px;
    color: #4b5563;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.workspace-header .logout-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.06);
}
body.dark-mode .workspace-header .logout-btn {
    color: #94a3b8;
}
body.dark-mode .workspace-header .logout-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.tools-dropdown { position: relative; }
.tools-dropdown .btn-alt { background: transparent; border: none; color: #4b5563; padding: 6px 12px; border-radius: 9999px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; transition: all 0.15s ease; }
.tools-dropdown .btn-alt:hover { color: #111827; background: rgba(0, 0, 0, 0.04); }
body.dark-mode .tools-dropdown .btn-alt { color: #94a3b8; }
body.dark-mode .tools-dropdown .btn-alt:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); }
.dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 300; display: flex; flex-direction: column; min-width: 190px; padding: 6px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow); }
body.dark-mode .dropdown-menu { background: rgba(18, 20, 26, 0.92); border-color: rgba(255, 255, 255, 0.1); }
.dropdown-item { width: 100%; padding: 8px 12px; color: var(--ink); background: transparent; border: 0; border-radius: 10px; text-align: left; cursor: pointer; font-size: 12px; font-weight: 600; transition: var(--transition); }
.dropdown-item:hover { color: #111827; background: rgba(0, 0, 0, 0.04); }
body.dark-mode .dropdown-item { color: #cbd5e1; }
body.dark-mode .dropdown-item:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); }

.main { width: min(100%, 1320px); margin: 0 auto; padding: 28px; }
.dashboard-main { padding: 32px clamp(20px, 3.5vw, 48px) 50px; }
.view { display: none; }
.view.active { display: block; animation: enter .18s ease both; }
.dashboard-view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.dashboard-view-header h1 { font-family: var(--font-display); font-size: clamp(28px, 3.2vw, 38px); font-weight: 900; line-height: 1.05; letter-spacing: -0.04em; color: #111827; }
.dashboard-view-header p { max-width: 620px; margin-top: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.stat, .card, .form-card { background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.stat:hover, .card:hover, .form-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.09); }
.stat { position: relative; min-height: 96px; padding: 20px; overflow: hidden; }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 900; line-height: 1; letter-spacing: -0.03em; color: #111827; }
.stat-label, .form-label, .settings-row-label, .mini-stat-label, .session-stat-label { display: block; color: var(--muted); font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }

.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: #111827; }
.registry-filters { display: flex; gap: 6px; margin-left: auto; }
.scripts-grid, .sessions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 16px; }
.script-card, .session-card { display: flex; min-width: 0; min-height: 250px; flex-direction: column; padding: 22px; background: rgba(255, 255, 255, 0.74); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.session-card { min-height: 225px; }
.script-card:hover, .session-card:hover { border-color: var(--line-strong); box-shadow: 0 22px 50px -10px rgba(0, 0, 0, 0.1); transform: translateY(-2px); }
.script-card.is-disabled { opacity: .68; }
.card-main { display: flex; flex: 1; flex-direction: column; }
.card-header { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card-kicker { display: none; }
.card-title-row, .session-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-name, .session-username { color: #111827; font-family: var(--font-display); font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -0.03em; }
.card-name { min-width: 0; overflow-wrap: anywhere; }
.card-badges { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.card-id-tag { margin-top: 8px; color: var(--quiet); font: 10px var(--mono); letter-spacing: .02em; }
.card-body, .session-card-body { padding: 14px 0 16px; }
.badge, .key-tag, .session-ip-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; color: var(--ink); background: rgba(15, 23, 42, 0.05); border: 1px solid var(--line); border-radius: 9999px; font: 700 9px var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.badge-public { color: var(--success); background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.2); }
.badge-private { color: var(--warning); background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.2); }
body.dark-mode .badge-public { background: #193c32; }
body.dark-mode .badge-private { background: #41301a; }
.badge-shield { color: var(--accent); }
.card-stat-grid, .session-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.session-stat-grid { grid-template-columns: repeat(3, 1fr); }
.card-mini-stat, .session-stat { display: flex; min-width: 0; min-height: 52px; flex-direction: column; justify-content: space-between; gap: 5px; padding: 10px 12px; background: rgba(15, 23, 42, 0.03); border: 1px solid var(--line); border-radius: 12px; }
.mini-stat-value, .session-stat-value { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }

.loadstring-wrapper { margin-bottom: 0; }
.loadstring-code { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 14px; color: #111827; background: #ffffff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font: 11px/1.5 var(--mono); transition: var(--transition); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03); }
.loadstring-code:hover { border-color: var(--line-strong); background: #f8fafc; transform: translateY(-1px); }
.loadstring-code span { overflow: hidden; color: #111827; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.loadstring-code .copy-icon { width: 16px; height: 16px; flex: 0 0 auto; color: #64748b; }
.loadstring-code:hover .copy-icon { color: #111827; }
.badge-subtle { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 6px; color: var(--muted); }
.badge-subtle-success { color: #059669; }
.badge-subtle-warning { color: #d97706; }
.badge-subtle-offline { color: #dc2626; }
.badge-subtle-shield { color: #475569; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.card-footer, .session-card-footer { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.card-actions-primary, .card-actions-secondary, .session-actions-primary, .session-actions-secondary { display: flex; align-items: center; gap: 8px; }
.card-footer .btn, .session-card-footer .btn { min-height: 34px; padding: 0 14px; border-radius: 9999px; }
.card-footer .btn-icon, .session-card-footer .btn-icon { width: 34px; height: 34px; border-radius: 50%; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 18px; border-radius: 9999px; font-weight: 600; font-size: 12.5px; border: 1px solid var(--line); background: #ffffff; color: var(--ink); cursor: pointer; transition: var(--transition); }
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.btn-primary { background: #111827; color: #ffffff; border-color: #111827; }
.btn-primary:hover { background: #000000; border-color: #000000; color: #ffffff; }

.session-card > .card-kicker { margin-bottom: 13px; }
.session-card-header { align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.session-identity { display: flex; min-width: 0; align-items: center; gap: 9px; }
.session-user-info { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.session-username { display: flex; min-width: 0; align-items: center; gap: 7px; }
.session-avatar { width: 34px; height: 34px; flex: 0 0 auto; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); border-radius: 50%; }
.session-script-name { overflow: hidden; color: var(--muted); font: 11px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.session-card-body { flex: 1; }
.session-ip-badge { flex: 0 1 auto; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stale-warning { color: var(--warning); font: 700 9px var(--mono); text-transform: uppercase; }

.form-card { padding: clamp(20px, 3vw, 36px); border-radius: 24px; }
.form-grid, .settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { margin-bottom: 14px; }
.form-label { margin-bottom: 6px; }
.form-help { margin-top: 5px; color: var(--muted); font-size: 11px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 0 14px; background: rgba(15, 23, 42, 0.03); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.toggle-row span { font-size: 12.5px; font-weight: 600; }
.toggle { position: relative; width: 34px; height: 20px; flex: 0 0 auto; background: var(--quiet); border-radius: 99px; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #ffffff; border-radius: 50%; transition: transform .15s; }
.toggle.on { background: var(--success); }
.toggle.on::after { transform: translateX(14px); }
.monaco-container { height: 330px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.view-header { margin-bottom: 18px; }
.view-header h1 { font-size: 24px; }
.view-header p { color: var(--muted); }
.settings-main, .settings-side { display: flex; flex-direction: column; gap: 14px; }
.settings-card { padding: 17px; }
.settings-card h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 16px; font-size: 14px; }
.profile-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.profile-preview img { width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 50%; }
.profile-info h2 { font-size: 15px; }
.profile-info p { color: var(--muted); font-size: 11px; }
.settings-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; margin-top: 10px; }
.settings-key-field { display: flex; gap: 6px; }
.settings-key-field .form-input { flex: 1; }
.settings-key-actions { display: flex; gap: 5px; }

#totpInput, #totpConfirm, #totpDisableInput { text-align: center; font-family: var(--mono); letter-spacing: 4px; }
#totpLoginError, #totpSetupError, #totpDisableError { margin-top: 12px; }
#verify2FABtn, #linkDiscordBtn, #updatePasswordBtn, #disable2FABtn, #setup2FABtn { width: 100%; }
#toolsDropdownTrigger svg { margin-left: 4px; transition: transform .2s; }
.view-header-spaced { margin-bottom: 40px; }
.form-grid-spaced { margin-bottom: 24px; }
.toggle-row-spaced, .form-group-spaced { margin-top: 12px; }
.lootlabs-help { margin-top: 4px; color: var(--success); }
.btn-deploy { width: 100%; padding: 14px; }
#linkDiscordBtn { margin-top: 14px; }
.settings-card-desc { margin-bottom: 16px; font-size: 12px; }
#updatePasswordBtn { margin-top: 10px; padding: 10px; }
#totpEnabledStatus .badge { width: 100%; margin-bottom: 10px; padding: 6px 10px; justify-content: center; }
#totpEnabledStatus p, #totpDisabledStatus p { margin-bottom: 12px; font-size: 11px; }
#setup2FABtn { padding: 10px; }
.form-actions-row, .secret-input-group { display: flex; gap: 8px; }
.form-actions-row { margin-top: 16px; }
#deleteBtn { flex: 1; }
#editForm button[type='submit'] { flex: 2; }
.modal-sm { max-width: 400px; }
.modal-md { max-width: 500px; }
.modal-body-padded { padding: 24px; }
.modal-body-centered { padding: 24px; text-align: center; }
#actionModalDesc { margin-bottom: 20px; color: var(--muted); }
.modal-footer-spaced { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 24px; border-top: 1px solid var(--line); }
.changelog-list { max-height: 500px; overflow-y: auto; }
.changelog-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.changelog-version, .changelog-version-warning { color: var(--accent); font-weight: 700; }
.changelog-version-warning { color: var(--warning); }
.changelog-date { color: var(--muted); font: 10px var(--mono); }
.changelog-changes { margin-top: 7px; padding-left: 18px; color: var(--muted); font-size: 12px; }
.known-issues { margin-top: 32px; padding-top: 24px; border-top: 1px dashed var(--line); }
.known-issues h3 { margin-bottom: 12px; color: var(--ink); font-size: 14px; letter-spacing: .05em; text-transform: uppercase; }
.known-issues .changelog-changes { font-size: 13px; opacity: .8; }
#totpSetupModal .modal { max-width: 440px; }
#totpQrContainer p { margin-bottom: 20px; font-size: 13px; }
#totpQr { display: inline-block; margin-bottom: 20px; padding: 16px; background: #ffffff; border: 1px solid var(--line-strong); border-radius: var(--radius); }
#qrImg { display: block; width: 200px; height: 200px; }
#totpSecretContainer, .totp-verify-group { text-align: left; }
#totpSecret { flex: 1; text-align: center; font-family: var(--mono); }
.totp-verify-group { margin-top: 20px; }
#resumeNotice { margin-bottom: 12px; font-size: 12px; }
.warning-box { margin-top: 24px; padding: 12px; background: #f9e5e2; border: 1px solid #dfaaa2; border-radius: var(--radius-sm); text-align: left; }
body.dark-mode .warning-box { background: #351f1d; border-color: #70403a; }
.warning-title { color: var(--danger); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.warning-text { margin-top: 4px; color: var(--muted); font-size: 12px; }
#totpDisableInput { font-size: 1.5rem; }
#turnstileModal .modal { max-width: 420px; }
#turnstileModal .modal-body { padding: 32px 24px; text-align: center; }
#turnstileModal p { margin-bottom: 24px; color: var(--muted); font-size: 13px; }

@media (max-width: 1024px) {
    .scripts-grid, .sessions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .dashboard-shell { display: block; }
    .dashboard-sidebar { position: sticky; z-index: 110; width: 100%; height: auto; padding: 10px 12px 0; border-right: 0; border-bottom: 2px solid var(--ink); }
    .sidebar-brand { padding: 0 2px 9px; border-bottom: 0; }
    .sidebar-brand-copy strong { font-size: 14px; }
    .sidebar-brand-copy span, .sidebar-section-label, .sidebar-rail, .sidebar-footnote { display: none; }
    .dashboard-nav { width: 100%; flex-direction: row; gap: 3px; overflow-x: auto; }
    .dashboard-nav button { display: flex; min-width: max-content; min-height: 35px; gap: 7px; padding: 0 10px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
    .dashboard-nav button.active { box-shadow: none; }
    .workspace-header { position: relative; min-height: 56px; padding: 8px 13px; }
    .workspace-context { display: none; }
    .user-profile { gap: 5px; }
    .user-profile > span { display: none; }
    .user-profile { width: 100%; }
    .tools-dropdown { margin-right: auto; }
    .dashboard-main { padding: 20px 13px 34px; }
    .dashboard-view-header { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 18px; }
    .dashboard-view-header > .btn { width: 100%; }
    .stats, .form-grid, .settings-layout { grid-template-columns: 1fr; }
    .stats { gap: 9px; margin-bottom: 18px; }
    .stat { min-height: 84px; }
    .scripts-grid, .sessions-grid { grid-template-columns: minmax(0, 1fr); }
    .session-stat-grid { grid-template-columns: 1fr; }
    .section-header { flex-wrap: wrap; }
    .registry-filters { order: 3; width: 100%; margin-left: 0; }
    .registry-filters .filter-tab { flex: 1; }
    .card-footer, .session-card-footer { align-items: stretch; flex-direction: column; }
    .card-actions-primary, .card-actions-secondary, .session-actions-primary, .session-actions-secondary { width: 100%; }
    .card-actions-primary .btn, .session-actions-primary .btn { flex: 1; }
    .card-actions-secondary, .session-actions-secondary { justify-content: flex-end; }
    .settings-row { grid-template-columns: 1fr; gap: 5px; }
}

@media (max-width: 430px) {
    .user-profile #userAvatar, .user-profile #userDisplayName, .user-profile #acousticToggle { display: none; }
    .script-card, .session-card { min-height: 0; padding: 17px; }
    .card-title-row { flex-direction: column; }
    .card-badges { justify-content: flex-start; }
    .card-body, .session-card-body { padding: 19px 0 21px; }
    .card-stat-grid { gap: 9px; }
    .form-card { padding: 14px; }
    .monaco-container { height: 280px; }
}

/* Upgrade Locked States */
.upgrade-locked-btn, .upgrade-locked-link {
    opacity: 0.42 !important;
    filter: grayscale(1) !important;
    position: relative !important;
    cursor: pointer !important;
}

.upgrade-locked-btn:hover, .upgrade-locked-link:hover {
    opacity: 0.85 !important;
}

.upgrade-locked-btn::after, .upgrade-locked-link::after {
    content: "Upgrade!";
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.upgrade-locked-btn:hover::after, .upgrade-locked-link:hover::after {
    opacity: 1;
}