/* GhostMods visual system — intentionally restrained, product-led, and consistent. */
:root {
    --ink: #18202a;
    --muted: #687382;
    --line: #dfe3e8;
    --navy: #0d1117;
    --blue: #719f18;
    --blue-dark: #5d8612;
    --canvas: #f5f6f4;
    --success: #4f7b14;
    --success-bg: #eef5e5;
    --danger: #b23a48;
    --danger-bg: #fff1f2;
    --amber: #8b5b13;
    --amber-bg: #fff7e8;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-subtle: #f8f9f7;
    --accent: #9fe52b;
    --accent-ink: #162006;
    --radius: 10px;
}

html[data-theme="dark"] {
    --ink: #eef1f4;
    --muted: #8d97a5;
    --line: #272f39;
    --navy: #090d12;
    --blue: #9fe52b;
    --blue-dark: #b3f24a;
    --canvas: #0b1016;
    --success: #a7e84a;
    --success-bg: #172313;
    --danger: #ff8590;
    --danger-bg: #2a161b;
    --amber: #f0bd68;
    --amber-bg: #271f11;
    --surface: #11171e;
    --surface-raised: #151c24;
    --surface-subtle: #0e141a;
    --accent: #9fe52b;
    --accent-ink: #101706;
}

html { background: var(--canvas); }
body {
    color: var(--ink);
    background: var(--canvas);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2 { letter-spacing: -.035em; }
button, input, select, textarea { font: inherit; }
button, .button-link { border-radius: 7px; box-shadow: none; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
button:hover, .button-link:hover { transform: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Authentication */
.auth-layout { grid-template-columns: minmax(380px, 42%) minmax(500px, 1fr); background: var(--surface); }
.brand-panel {
    position: relative;
    overflow: hidden;
    padding: 38px clamp(42px, 6vw, 88px);
    color: #f3f5f7;
    background: #0b1016;
    border-right: 1px solid #202831;
}
.brand-panel::after {
    content: '';
    position: absolute;
    right: -180px;
    bottom: -240px;
    width: 480px;
    height: 480px;
    border: 1px solid #9fe52b24;
    border-radius: 50%;
    box-shadow: 0 0 0 70px #9fe52b09, 0 0 0 140px #9fe52b06;
    pointer-events: none;
}
.brand { gap: 11px; font-size: 16px; letter-spacing: -.025em; }
.brand-mark { width: 29px; height: 29px; filter: none; }
.brand-copy { position: relative; z-index: 1; max-width: 480px; }
.brand-copy h1 { max-width: 460px; margin: 15px 0 19px; font-size: clamp(36px, 3.7vw, 54px); line-height: 1.05; }
.brand-copy>p:last-child { max-width: 430px; color: #97a2af; font-size: 16px; }
.brand-panel .eyebrow { color: var(--accent); }
.brand-footer { position: relative; z-index: 1; color: #66717f; font-size: 12px; letter-spacing: .02em; }
.auth-panel { padding: 44px clamp(34px, 7vw, 96px); background: var(--surface); }
.auth-card { width: min(100%, 420px); }
.auth-card h2 { margin: 9px 0 7px; font-size: 34px; }
.intro { margin-bottom: 25px; font-size: 14px; }
.form-stack { gap: 7px; }
.form-stack label { margin-top: 9px; color: var(--ink); font-size: 12px; letter-spacing: .01em; }
.form-stack input, .settings-card .form-stack input, .settings-card .form-stack select {
    height: 46px;
    border-color: var(--line);
    border-radius: 7px;
    background: var(--surface-subtle);
    color: var(--ink);
    box-shadow: none;
}
.form-stack input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #9fe52b18; }
.form-stack>button { min-height: 46px; margin-top: 17px; background: var(--accent); color: var(--accent-ink); }
.form-stack>button:hover { background: #aff044; }
.auth-switch { margin-top: 22px; font-size: 13px; }
.alert { border-radius: 7px; padding: 12px 14px; }
.password-toggle:hover { background: transparent; color: var(--ink); transform: translateY(-50%); }

/* One consistent navigation surface */
body.nav-open { overflow: hidden; }
.global-site-header {
    position: sticky;
    z-index: 80;
    top: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: 64px;
    padding: 0 max(20px, calc((100vw - 1240px) / 2));
    border-bottom: 1px solid var(--line);
    background: #ffffffed;
    backdrop-filter: blur(14px);
}
html[data-theme="dark"] .global-site-header { background: #0b1016ed; }
.nav-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-right: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
}
.nav-toggle:hover { background: var(--surface-subtle); }
.nav-toggle span { display: block; width: 18px; height: 1.5px; border-radius: 2px; background: currentColor; }
.global-brand {
    display: inline-flex;
    width: max-content;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font: 700 15px Manrope, sans-serif;
    letter-spacing: -.035em;
    text-decoration: none;
}
.global-brand .brand-mark { width: 27px; height: 27px; }
.header-account {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.header-account:hover { color: var(--ink); }
.header-account .avatar { width: 29px; height: 29px; }
.nav-scrim {
    position: fixed;
    z-index: 95;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    background: #05080bb8;
    backdrop-filter: blur(2px);
    transition: opacity .2s ease, visibility .2s ease;
}
.nav-drawer {
    position: fixed;
    z-index: 100;
    inset: 0 auto 0 0;
    display: flex;
    width: min(360px, calc(100vw - 32px));
    flex-direction: column;
    overflow-y: auto;
    color: #eef1f4;
    background: #0b1016;
    border-right: 1px solid #27313b;
    box-shadow: 24px 0 60px #0006;
    transform: translateX(-102%);
    transition: transform .22s ease;
}
.nav-open .nav-scrim { opacity: 1; visibility: visible; }
.nav-open .nav-drawer { transform: translateX(0); }
.nav-drawer-header {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 22px;
    border-bottom: 1px solid #202831;
}
.nav-drawer .global-brand { color: #f1f3f5; }
.nav-close {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8893a0;
    font-size: 25px;
    font-weight: 300;
    line-height: 1;
}
.nav-close:hover { background: #141b22; color: #fff; }
.drawer-links { padding: 19px 12px 24px; }
.nav-section-label {
    margin: 19px 12px 7px;
    color: #5f6b78;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.nav-section-label:first-child { margin-top: 2px; }
.drawer-links a {
    position: relative;
    display: grid;
    gap: 1px;
    margin: 2px 0;
    padding: 10px 14px 10px 16px;
    border-left: 2px solid transparent;
    color: #b7c0ca;
    text-decoration: none;
}
.drawer-links a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 6px;
    background: transparent;
}
.drawer-links a span { font-size: 13px; font-weight: 650; }
.drawer-links a small { color: #626e7b; font-size: 10px; }
.drawer-links a:hover { color: #fff; }
.drawer-links a:hover::before { background: #121920; }
.drawer-links a.active { border-left-color: var(--accent); color: #fff; }
.drawer-links a.active::before { background: #151d24; }
.drawer-links a.active small { color: #8f9aa6; }
.nav-drawer-account {
    display: grid;
    gap: 16px;
    margin-top: auto;
    padding: 20px 22px 24px;
    border-top: 1px solid #202831;
}
.drawer-account-identity { display: flex; min-width: 0; align-items: center; gap: 10px; }
.drawer-account-identity>div { display: grid; min-width: 0; }
.drawer-account-identity strong { overflow: hidden; color: #f0f2f4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-account-identity small { overflow: hidden; color: #66727e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sign-out-link { width: max-content; color: #98a3ae; font-size: 11px; font-weight: 650; text-decoration: none; }
.sign-out-link:hover { color: var(--accent); }

/* Shared application shell */
.dashboard-shell { width: min(1240px, calc(100% - 56px)); padding-top: 18px; }
.topbar { min-height: 66px; }
.account-menu { gap: 7px; color: var(--muted); font-size: 13px; }
.account-menu a { margin-left: 5px; }
.account-menu .panel-link {
    margin-left: 3px;
    padding: 7px 10px;
    border-color: transparent;
    border-radius: 6px;
    color: var(--muted);
}
.account-menu .panel-link:hover, .account-menu .panel-link.active {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}
.avatar { width: 30px; height: 30px; background: var(--success-bg); color: var(--success); }
.store-hero, .dashboard-header, .member-hero { padding: 48px 0 30px; }
.store-hero h1 { margin: 7px 0 10px; font-size: clamp(32px, 4vw, 44px); }
.dashboard-header h1, .member-hero h1 { margin-top: 7px; font-size: 32px; }
.eyebrow { font-size: 10px; letter-spacing: .14em; }

.stat-card, .content-card, .product-card, .license-card, .settings-console, .status-console {
    border-color: var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 1px 2px #1018200a;
}
.stat-card { min-height: 126px; padding: 21px; }
.stat-card strong { font-size: 31px; }
.content-card { margin-top: 20px; }
.section-heading { padding: 21px 22px 17px; }
.section-heading h2 { margin-top: 5px; }
th { padding: 11px 22px; background: var(--surface-subtle); font-size: 10px; }
td { padding: 14px 22px; }

/* Store */
.product-grid { gap: 14px; }
.product-card { padding: 24px; }
.product-card.featured { padding: 23px; border: 1px solid var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.popular-label { top: 15px; right: 16px; padding: 3px 8px; color: var(--accent-ink); background: var(--accent); }
.product-card h2 { margin-top: 7px; }
.product-price { margin: 20px 0 15px; font-size: 31px; }
.product-card li { border-top: 1px solid var(--line); padding: 9px 0; }
.product-card li::before { content: '—'; color: var(--muted); }

/* Member panel */
.panel-app-shell { display: block; min-height: calc(100vh - 64px); background: var(--canvas); }
.panel-sidebar { width: auto; padding: 26px 16px 18px; background: #0a0f14; border-right: 1px solid #202831; }
.panel-sidebar nav { margin-top: 39px; }
.panel-sidebar nav a { padding: 10px 12px; border-radius: 6px; font-size: 12px; }
.panel-sidebar nav a:hover, .panel-sidebar nav a.active { border-color: #29323c; background: #141b22; }
.panel-main { width: min(1240px, calc(100% - 56px)); margin: auto; padding: 18px 0 58px; }
.panel-main>.topbar { min-height: 78px; }
.panel-hero {
    min-height: 280px;
    grid-template-columns: 1fr;
    margin-top: 24px;
    padding: 42px clamp(30px, 5vw, 58px);
    border: 1px solid #29323c;
    border-radius: 12px;
    background: #0d1319;
    box-shadow: none;
}
.hero-copy { max-width: 690px; }
.hero-copy h2 { margin: 16px 0 12px; font-size: clamp(36px, 4vw, 50px); }
.hero-copy>p { max-width: 650px; }
.status-pill { border-radius: 20px; }
.download-button { border-radius: 7px; }
.control-grid { gap: 16px; margin-top: 18px; }
.console-heading, .setting-row { padding-left: 22px; padding-right: 22px; }
.settings-console, .status-console { box-shadow: none; }

/* Community, messaging, settings, administration */
.community-hero { margin: 28px 0 20px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--surface); box-shadow: none; }
.community-hero .eyebrow { color: var(--blue); }
.community-hero .announcement { color: var(--muted); }
.community-layout { gap: 16px; }
.forum-post { padding: 21px; border-radius: var(--radius); background: var(--surface); }
.messages-layout { min-height: 580px; }
.message-stream { background: var(--surface-subtle); }
.message-bubble { border-radius: 4px 10px 10px; }
.message-bubble.mine { border-radius: 10px 4px 10px 10px; background: #5f8f17; }
.settings-grid { gap: 14px; }
.settings-card { padding: 23px; }
.settings-card h2 { font-size: 20px; }
.settings-card .form-stack { gap: 10px; }
.primary-button { border-radius: 7px; background: var(--accent); color: var(--accent-ink); }
.primary-button:hover { background: #aff044; }
.reset-button { border-radius: 6px; }
.flash-messages { position: fixed; z-index: 100; top: 16px; right: 18px; width: min(380px, calc(100% - 36px)); }
.flash-messages .alert { box-shadow: 0 10px 30px #0005; }

/* Account-private connected PCs */
.files-page { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 72px; }
.files-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 25px; }
.files-heading h1 { margin: 7px 0 8px; color: var(--ink); font-size: clamp(32px, 4vw, 46px); letter-spacing: -.04em; }
.files-heading>div>p:last-child { max-width: 670px; color: var(--muted); }
.files-heading-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.files-refresh { border: 1px solid var(--line); border-radius: 30px; padding: 8px 12px; color: var(--ink); background: var(--surface); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.files-refresh:hover { border-color: var(--accent); color: var(--accent-ink); }
.files-security-pill, .device-state { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 30px; padding: 8px 11px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 700; }
.device-state i { width: 7px; height: 7px; border-radius: 50%; background: #7c8794; }
.device-state.online { color: #5f8f17; }
.device-state.online i { background: var(--accent); box-shadow: 0 0 0 4px #b7ff3820; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.device-card { min-height: 245px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.device-card-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.device-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; color: var(--accent); background: var(--surface-subtle); font-size: 10px; font-weight: 800; }
.device-card h2 { margin: 23px 0 6px; color: var(--ink); font-size: 20px; }
.device-card>p { min-height: 42px; color: var(--muted); font-size: 13px; }
.device-open { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; color: var(--ink); font-size: 13px; font-weight: 750; text-decoration: none; }
.device-open:hover { color: var(--accent); }
.device-card form { display: inline; }
.device-revoke { min-height: auto; margin: 17px 0 0 18px; padding: 0; color: var(--muted); background: transparent; font-size: 11px; }
.device-revoke:hover { color: #e76f7b; background: transparent; }
.files-empty { display: flex; grid-column: 1 / -1; align-items: center; gap: 18px; padding: 34px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.files-empty>span { display: grid; place-items: center; flex: 0 0 auto; width: 45px; height: 45px; border-radius: 10px; color: var(--accent); background: var(--surface-subtle); font-weight: 800; }
.files-empty h2 { margin-bottom: 5px; color: var(--ink); font-size: 19px; }
.files-empty p { color: var(--muted); font-size: 13px; }
.file-browser { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.browser-toolbar { display: flex; align-items: center; gap: 14px; padding: 14px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.browser-toolbar>div { min-width: 0; flex: 1; }
.browser-toolbar small, .browser-toolbar strong { display: block; }
.browser-toolbar small { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.browser-toolbar strong { overflow: hidden; color: var(--ink); font: 600 12px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.browser-toolbar button, .file-row button { min-height: 34px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 11px; }
.browser-toolbar button:disabled { cursor: default; opacity: .45; }
.file-status { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.file-status.error { color: #e76f7b; }
.file-list { min-height: 260px; }
.file-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 8px 15px; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-kind { color: var(--muted); font: 750 9px Consolas, monospace; }
.file-row strong, .file-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row strong { color: var(--ink); font-size: 13px; }
.file-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.folder-empty { padding: 54px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.file-upload-form { display: grid; grid-template-columns: 1fr minmax(210px, 340px) auto; align-items: center; gap: 14px; padding: 16px; border-top: 1px solid var(--line); background: var(--surface-subtle); }
.file-upload-form strong, .file-upload-form small { display: block; }
.file-upload-form strong { color: var(--ink); font-size: 12px; }
.file-upload-form small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.file-upload-form input { min-width: 0; color: var(--muted); font-size: 11px; }
.file-upload-form button { min-height: 38px; margin: 0; padding: 0 15px; background: var(--accent); color: var(--accent-ink); font-size: 11px; }

/* Administrator-only security activity */
.security-stat-link { color: inherit; text-decoration: none; }
.security-stat-link small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.security-stat-link:hover { border-color: var(--accent); }
.security-page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 76px; }
.security-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.security-heading h1 { margin: 7px 0 8px; color: var(--ink); font-size: clamp(34px, 4.5vw, 50px); letter-spacing: -.045em; }
.security-heading p:last-child { max-width: 680px; color: var(--muted); }
.security-heading-actions { display: flex; gap: 8px; }
.security-heading-actions a { display: inline-flex; min-height: 38px; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: 11px; font-weight: 750; text-decoration: none; }
.security-heading-actions .primary-link { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.security-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.security-stats article { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.security-stats span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.security-stats strong { display: block; margin-top: 7px; color: var(--ink); font-size: 27px; }
.security-stats .severity-high { border-color: #e66c7948; }
.security-stats .severity-high strong { color: #e76f7b; }
.security-stats .severity-medium strong { color: #e4a94d; }
.security-note { display: flex; gap: 15px; margin-bottom: 14px; padding: 15px 17px; border: 1px solid #7da93045; border-radius: 9px; background: #8fbd3110; }
.security-note strong { flex: 0 0 auto; color: var(--ink); font-size: 11px; }
.security-note p { color: var(--muted); font-size: 11px; }
.source-defense-card { overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.source-defense-explainer { padding: 13px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.source-defense-list { padding: 8px 14px 14px; }
.source-defense-row { display: grid; grid-template-columns: minmax(0, 1fr) 210px auto; align-items: center; gap: 18px; margin-top: 7px; padding: 13px 14px; border: 1px solid var(--line); border-left: 3px solid #e4a94d; border-radius: 8px; background: var(--surface-subtle); }
.source-defense-row.defense-block { border-left-color: #e76f7b; }
.source-defense-row>div:first-child { min-width: 0; }
.source-defense-row strong { margin-left: 9px; color: var(--ink); font-size: 11px; }
.source-defense-row p { margin-top: 6px; color: var(--muted); font-size: 9px; }
.defense-action { display: inline-flex; min-width: 62px; min-height: 22px; align-items: center; justify-content: center; border-radius: 5px; color: #d79b3c; background: #d79b3c14; font: 800 8px Consolas, monospace; }
.defense-block .defense-action { color: #e76f7b; background: #e76f7b14; }
.source-defense-meta { display: grid; gap: 4px; color: var(--muted); font-size: 9px; }
.source-defense-row form { margin: 0; }
.source-defense-row button { min-height: 32px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 9px; font-weight: 800; }
.source-defense-empty { padding: 28px 14px 22px; color: var(--muted); text-align: center; }
.source-defense-empty strong { color: var(--ink); font-size: 11px; }
.source-defense-empty p { margin-top: 4px; font-size: 9px; }
.security-filters { display: grid; grid-template-columns: 175px 190px minmax(220px, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 14px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.security-filters label { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.security-filters select, .security-filters input { width: 100%; min-height: 38px; margin-top: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface-subtle); font-family: inherit; font-size: 11px; font-weight: 500; }
.security-filters button { min-height: 38px; margin: 0; padding: 0 17px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; }
.security-log-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.security-log-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.security-log-head h2 { margin-top: 3px; color: var(--ink); font-size: 20px; }
.security-log-head>span { color: var(--muted); font-size: 10px; font-weight: 700; }
.security-event { display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); border-left: 3px solid #7d8998; }
.security-event:last-child { border-bottom: 0; }
.security-event.severity-critical, .security-event.severity-high { border-left-color: #e76f7b; }
.security-event.severity-medium { border-left-color: #e4a94d; }
.security-event.severity-low { border-left-color: #6d99ce; }
.security-event.severity-info { border-left-color: #84b82b; }
.security-event-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.security-event-title strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.security-severity { flex: 0 0 auto; min-width: 56px; padding: 4px 6px; border-radius: 5px; color: var(--muted); background: var(--surface-subtle); font: 800 8px Consolas, monospace; text-align: center; }
.severity-high .security-severity, .severity-critical .security-severity { color: #e76f7b; background: #e76f7b14; }
.severity-medium .security-severity { color: #d79b3c; background: #d79b3c14; }
.event-count { padding: 3px 6px; border-radius: 10px; color: var(--muted); background: var(--surface-subtle); font-size: 9px; font-weight: 800; }
.security-event-main>p { margin: 8px 0; color: var(--muted); font-size: 11px; }
.security-event-meta { display: flex; flex-wrap: wrap; gap: 6px 13px; color: var(--muted); font-size: 9px; }
.security-event-meta code, .security-event-identity code { overflow-wrap: anywhere; color: var(--ink); font: 500 9px Consolas, monospace; }
.security-event-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; gap: 5px 9px; padding-left: 17px; border-left: 1px solid var(--line); }
.security-event-identity span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.security-empty { padding: 54px 20px; color: var(--muted); text-align: center; }
.security-empty strong { color: var(--ink); }
.security-empty p { margin-top: 4px; font-size: 11px; }
.security-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.security-pagination a { color: var(--ink); font-weight: 750; text-decoration: none; }

html[data-theme="dark"] .auth-panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .license-card,
html[data-theme="dark"] .empty-licenses { background: var(--surface); border-color: var(--line); box-shadow: 0 1px 2px #0003; }
html[data-theme="dark"] .form-stack input,
html[data-theme="dark"] .settings-card .form-stack input,
html[data-theme="dark"] .settings-card .form-stack select,
html[data-theme="dark"] .admin-form input,
html[data-theme="dark"] .admin-form select,
html[data-theme="dark"] .inline-form input,
html[data-theme="dark"] .panel-content-form input[type="text"],
html[data-theme="dark"] .panel-content-form input[type="url"],
html[data-theme="dark"] .panel-content-form textarea { background: var(--surface-subtle); border-color: var(--line); }
html[data-theme="dark"] .account-menu .panel-link { color: var(--muted); border-color: transparent; }
html[data-theme="dark"] .account-menu .panel-link:hover,
html[data-theme="dark"] .account-menu .panel-link.active { color: var(--ink); border-color: var(--line); background: var(--surface-raised); }
html[data-theme="dark"] th { background: var(--surface-subtle); }

@media (max-width: 900px) {
    .auth-layout { grid-template-columns: 36% 1fr; }
    .brand-panel { padding-inline: 34px; }
    .brand-copy h1 { font-size: 36px; }
    .account-menu { max-width: 70%; flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 760px) {
    .auth-layout { display: block; }
    .auth-panel { min-height: 100vh; padding: 28px 22px; }
    .mobile-brand { display: flex; margin-bottom: 38px; }
    .dashboard-shell { width: min(100% - 28px, 1240px); padding-top: 10px; }
    .global-site-header { padding-inline: 12px 15px; }
    .header-account>span:last-child { display: none; }
    .nav-toggle { margin-right: 4px; }
    .topbar { align-items: flex-start; gap: 14px; padding: 10px 0; }
    .account-menu { max-width: 72%; gap: 4px; }
    .account-menu .panel-link { padding: 5px 7px; font-size: 11px; }
    .store-hero, .dashboard-header, .member-hero { padding: 34px 0 24px; }
    .panel-app-shell { display: block; }
    .panel-sidebar { border-right: 0; border-bottom: 1px solid #202831; }
    .panel-main { width: min(100% - 28px, 1240px); padding: 10px 0 40px; }
    .panel-hero { padding: 32px 24px; }
    .hero-copy h2 { font-size: 36px; }
    .control-grid { grid-template-columns: 1fr; }
    .recovery-code-box>div { grid-template-columns: 1fr; }
    .files-page { width: min(100% - 28px, 1120px); padding-top: 34px; }
    .files-heading { align-items: flex-start; flex-direction: column; }
    .file-upload-form { grid-template-columns: 1fr; }
    .file-row { grid-template-columns: 40px minmax(0, 1fr) auto; padding-inline: 10px; }
    .security-page { width: min(100% - 28px, 1240px); padding-top: 34px; }
    .security-heading { align-items: flex-start; flex-direction: column; }
    .security-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .security-note { display: block; }
    .security-note p { margin-top: 5px; }
    .source-defense-row { grid-template-columns: 1fr; gap: 8px; }
    .source-defense-row form button { width: 100%; }
    .security-filters { grid-template-columns: 1fr; }
    .security-event { grid-template-columns: 1fr; }
    .security-event-identity { padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
