:root {
    color-scheme: dark;
    --background: #070707;
    --surface: #11110f;
    --surface-soft: #171713;
    --surface-raised: #1c1b16;
    --border: rgba(213, 170, 72, 0.2);
    --border-soft: rgba(255, 255, 255, 0.075);
    --gold: #d5aa48;
    --gold-light: #f5dc8a;
    --text: #f6f2e7;
    --muted: #aaa79f;
    --green: #43cc7a;
    --orange: #f59e42;
    --red: #f05c5c;
    --blue: #5b8ff9;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 0%, rgba(213, 170, 72, 0.13), transparent 28rem),
        radial-gradient(circle at 92% 32%, rgba(119, 87, 19, 0.09), transparent 25rem),
        var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a { color: var(--gold-light); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
code {
    border: 1px solid var(--border-soft);
    border-radius: .4rem;
    background: rgba(255,255,255,.04);
    padding: .15rem .35rem;
    color: var(--gold-light);
}

.skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 100;
    padding: .7rem 1rem;
    border-radius: .65rem;
    background: var(--gold);
    color: #111;
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

.page-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.6rem 0 2.2rem;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: var(--text);
    text-decoration: none;
}
.brand-mark {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: .82rem;
    background: linear-gradient(145deg, #2b210d, #0b0b0a);
    color: var(--gold-light);
    font-family: Georgia, serif;
    font-weight: 800;
    box-shadow: inset 0 0 22px rgba(213,170,72,.09);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; }
.brand small { margin-top: .08rem; color: var(--muted); font-size: .72rem; }
.topnav { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; }
.topnav > a, .nav-button {
    border: 1px solid transparent;
    border-radius: .65rem;
    background: transparent;
    padding: .55rem .75rem;
    color: var(--muted);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 720;
    cursor: pointer;
}
.topnav > a:hover, .nav-button:hover {
    border-color: var(--border);
    background: rgba(213,170,72,.07);
    color: var(--gold-light);
}
.account-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .6rem .3rem .3rem;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    color: #dcd8ce;
    font-size: .82rem;
    font-weight: 700;
}
.account-chip img, .avatar-fallback {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
}
.account-chip img { object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; background: #5865f2; color: #fff; }
.menu-toggle {
    display: none;
    align-items: center;
    gap: .4rem;
    border: 1px solid var(--border);
    border-radius: .65rem;
    background: rgba(213,170,72,.07);
    padding: .55rem .7rem;
    color: var(--gold-light);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 800;
}

.admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    gap: 1.15rem;
}
.admin-content { min-width: 0; }
.admin-sidebar {
    position: sticky;
    top: 1rem;
    z-index: 20;
    display: flex;
    min-height: calc(100vh - 8rem);
    flex-direction: column;
    gap: 1.2rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: linear-gradient(155deg,rgba(213,170,72,.055),transparent 38%),#0e0e0d;
    box-shadow: 0 18px 50px rgba(0,0,0,.27);
}
.sidebar-block { display: grid; gap: .35rem; }
.sidebar-title {
    margin: 0 .5rem .28rem;
    color: var(--gold);
    font-size: .67rem;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.6rem;
    padding: .55rem .62rem;
    border: 1px solid transparent;
    border-radius: .66rem;
    color: #a9a69e;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 740;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
.sidebar-link:hover {
    border-color: var(--border-soft);
    background: rgba(255,255,255,.025);
    color: var(--text);
}
.sidebar-link.active {
    border-color: rgba(213,170,72,.24);
    background: linear-gradient(90deg,rgba(213,170,72,.14),rgba(213,170,72,.035));
    color: var(--gold-light);
}
.sidebar-icon {
    display: grid;
    width: 1.6rem;
    height: 1.6rem;
    flex: 0 0 1.6rem;
    place-items: center;
    border-radius: .45rem;
    background: rgba(255,255,255,.035);
    color: currentColor;
    font-size: .76rem;
}
.sidebar-link.active .sidebar-icon { background: rgba(213,170,72,.12); }
.sidebar-readonly {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-top: auto;
    padding: .72rem;
    border: 1px solid rgba(67,204,122,.13);
    border-radius: .7rem;
    background: rgba(67,204,122,.035);
}
.sidebar-readonly > span { color: var(--green); font-size: .6rem; line-height: 1.8; }
.sidebar-readonly strong, .sidebar-readonly small { display: block; }
.sidebar-readonly strong { color: #bcd9c7; font-size: .7rem; }
.sidebar-readonly small { margin-top: .16rem; color: #747871; font-size: .6rem; line-height: 1.35; }
.sidebar-backdrop { display: none; }

.eyebrow, .card-kicker {
    color: var(--gold);
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: .5rem; margin: 0 0 .8rem; }
.eyebrow::before { width: 1.5rem; height: 1px; background: var(--gold); content: ""; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; }

.login-layout {
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .8fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 7rem);
    padding: clamp(2rem, 7vw, 5.5rem);
    border: 1px solid var(--border);
    border-radius: 1.45rem;
    background: linear-gradient(125deg, rgba(213,170,72,.105), transparent 45%), linear-gradient(180deg,#151513,#0c0c0b);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.login-copy h1 { max-width: 620px; margin-bottom: 1.2rem; font-size: clamp(2.7rem, 6vw, 5.3rem); line-height: .98; letter-spacing: -.045em; }
.hero-copy { max-width: 580px; color: #c6c1b7; font-size: clamp(1rem,2vw,1.17rem); }
.discord-button, .primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    margin-top: .8rem;
    border-radius: .76rem;
    padding: .85rem 1.1rem;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    transition: transform 150ms ease, filter 150ms ease;
}
.discord-button { background: #5865f2; box-shadow: 0 12px 35px rgba(88,101,242,.25); }
.primary-button { background: linear-gradient(135deg,#d5aa48,#9b6f18); color: #111; }
.discord-button:hover, .primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.login-hint { margin: .9rem 0 0; color: #85827a; font-size: .82rem; }
.visual-card {
    position: relative;
    min-height: 390px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 2rem;
    border: 1px solid rgba(213,170,72,.28);
    border-radius: 1.4rem;
    background: rgba(5,5,5,.68);
    box-shadow: inset 0 0 60px rgba(213,170,72,.04), 0 25px 80px #000;
}
.visual-glow { position: absolute; width: 16rem; height: 16rem; left: 50%; top: 35%; border-radius: 50%; background: rgba(213,170,72,.14); filter: blur(65px); transform: translate(-50%,-50%); }
.visual-logo { position: relative; color: var(--gold-light); text-align: center; font: 800 clamp(5rem,12vw,8rem)/1 Georgia,serif; text-shadow: 0 0 45px rgba(213,170,72,.18); }
.visual-line { position: relative; display: flex; align-items: center; justify-content: center; gap: .55rem; margin-top: 1.8rem; color: #cbc6ba; font-size: .85rem; }
.visual-line span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); }
.visual-grid { position: relative; display: grid; grid-template-columns: repeat(3,1fr); gap: .55rem; margin-top: 1.8rem; }
.visual-grid i { height: 2.8rem; border: 1px solid var(--border-soft); border-radius: .65rem; background: linear-gradient(120deg,rgba(255,255,255,.04),rgba(213,170,72,.04)); }

.access-card {
    max-width: 760px;
    margin: 8vh auto;
    padding: clamp(2rem,6vw,4rem);
    border: 1px solid var(--border);
    border-radius: 1.35rem;
    background: linear-gradient(145deg,rgba(213,170,72,.09),transparent 48%),var(--surface);
    box-shadow: var(--shadow);
}
.access-card h1 { margin-bottom: 1rem; font-size: clamp(2.1rem,6vw,3.7rem); line-height: 1.05; }
.access-card > p:not(.eyebrow) { color: #bdb9af; }
.access-icon { display: grid; width: 3.4rem; height: 3.4rem; place-items: center; margin-bottom: 1.5rem; border-radius: 1rem; font-size: 1.7rem; font-weight: 900; }
.access-icon.warning { background: rgba(245,158,66,.13); color: var(--orange); }
.access-icon.danger { background: rgba(240,92,92,.13); color: var(--red); }
.config-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.security-note { padding-top: 1rem; border-top: 1px solid var(--border-soft); font-size: .88rem; }

.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin: 2.5rem 0 1.2rem; }
.dashboard-heading h1 { margin: 0 0 .4rem; font-size: clamp(2.3rem,5vw,4rem); line-height: 1; }
.dashboard-heading p:last-child { margin: 0; color: var(--muted); }
.refresh-chip { display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap; padding: .55rem .8rem; border: 1px solid var(--border-soft); border-radius: 999px; background: rgba(255,255,255,.025); color: var(--muted); font-size: .8rem; font-weight: 700; }
.pulse-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(67,204,122,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(67,204,122,0); } 100% { box-shadow: 0 0 0 0 rgba(67,204,122,0); } }

.health-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.2rem;
    padding: 1.45rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: linear-gradient(110deg,rgba(67,204,122,.09),transparent 42%),var(--surface);
}
.health-card.warning { background: linear-gradient(110deg,rgba(245,158,66,.10),transparent 42%),var(--surface); border-color: rgba(245,158,66,.26); }
.health-card.danger, .health-card.offline { background: linear-gradient(110deg,rgba(240,92,92,.10),transparent 42%),var(--surface); border-color: rgba(240,92,92,.28); }
.health-orb { display: grid; width: 3.25rem; height: 3.25rem; place-items: center; border-radius: 50%; background: rgba(67,204,122,.14); color: var(--green); font-size: 1.35rem; font-weight: 900; }
.warning .health-orb { background: rgba(245,158,66,.14); color: var(--orange); }
.danger .health-orb, .offline .health-orb { background: rgba(240,92,92,.14); color: var(--red); }
.health-card h2 { margin: .18rem 0 .2rem; font-size: 1.35rem; }
.health-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.health-time { padding-left: 1.4rem; border-left: 1px solid var(--border-soft); text-align: right; }
.health-time span, .health-time strong { display: block; }
.health-time span { color: var(--muted); font-size: .72rem; }
.health-time strong { margin-top: .2rem; font-size: .88rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .8rem; margin: .8rem 0; }
.metric-card { min-width: 0; padding: 1.05rem; border: 1px solid var(--border-soft); border-radius: .9rem; background: var(--surface); }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: .74rem; font-weight: 700; }
.metric-card strong { margin: .35rem 0 .12rem; overflow: hidden; color: var(--text); font-size: 1.45rem; text-overflow: ellipsis; }
.metric-card small { color: #77746c; font-size: .68rem; }
.metric-card.warning strong { color: var(--orange); }
.metric-card.danger strong { color: var(--red); }

.content-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(260px,.7fr); gap: .8rem; margin-bottom: .8rem; }
.panel-card { border: 1px solid var(--border-soft); border-radius: 1rem; background: var(--surface); padding: 1.2rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2 { margin: .15rem 0 0; font-size: 1.25rem; }
.count-badge, .soon-badge { border: 1px solid var(--border); border-radius: 999px; background: rgba(213,170,72,.08); padding: .3rem .55rem; color: var(--gold-light); font-size: .68rem; font-weight: 800; }
.module-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.module-item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-width: 0; padding: .72rem .78rem; border: 1px solid var(--border-soft); border-radius: .7rem; background: rgba(255,255,255,.018); }
.module-name { min-width: 0; }
.module-name strong, .module-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-name strong { font-size: .82rem; }
.module-name small { margin-top: .12rem; color: #77746c; font-size: .66rem; }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; color: var(--green); font-size: .65rem; font-weight: 850; }
.status-pill::before { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; content: ""; }
.status-pill.off { color: var(--red); }
.status-pill.error { color: var(--orange); }
.system-list { margin: 0; }
.system-list div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .82rem 0; border-bottom: 1px solid var(--border-soft); }
.system-list div:last-child { border-bottom: 0; }
.system-list dt { color: var(--muted); font-size: .77rem; }
.system-list dd { margin: 0; text-align: right; font-size: .78rem; font-weight: 800; }

.logs-panel { margin-bottom: .8rem; }
.live-label { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .72rem; }
.live-label i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--green); }
.log-list { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.log-list li { overflow-wrap: anywhere; padding: .65rem .75rem; border-radius: .55rem; background: #0b0b0a; color: #bdb9af; font: .73rem/1.5 ui-monospace,SFMono-Regular,Consolas,monospace; }
.log-list .empty-state { color: #76736c; font-family: inherit; text-align: center; }
.future-card { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.2rem; border: 1px dashed var(--border); border-radius: .9rem; background: rgba(213,170,72,.03); }
.future-card > span:first-child { display: grid; width: 2.2rem; height: 2.2rem; place-items: center; border-radius: .6rem; background: rgba(213,170,72,.09); color: var(--gold); }
.future-card div { flex: 1; }
.future-card strong { font-size: .85rem; }
.future-card p { margin: .12rem 0 0; color: var(--muted); font-size: .75rem; }

.logs-heading { margin-top: 1.2rem; }
.log-type-nav {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: .5rem;
    margin-bottom: .8rem;
    padding: .42rem;
    border: 1px solid var(--border-soft);
    border-radius: .85rem;
    background: rgba(255,255,255,.014);
}
.logs-page .log-type-nav { grid-template-columns: repeat(4,minmax(0,1fr)); }
.log-type-nav > a {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .58rem;
    padding: .62rem .68rem;
    border: 1px solid transparent;
    border-radius: .65rem;
    color: #8d8980;
    text-decoration: none;
    transition: border-color 150ms ease,background 150ms ease,color 150ms ease;
}
.log-type-nav > a:hover { border-color: var(--border-soft); background: rgba(255,255,255,.022); color: #d7d2c7; }
.log-type-nav > a.active {
    border-color: rgba(213,170,72,.3);
    background: linear-gradient(100deg,rgba(213,170,72,.13),rgba(213,170,72,.035));
    color: var(--gold-light);
    box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.log-type-icon {
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 1.8rem;
    place-items: center;
    border-radius: .5rem;
    background: rgba(255,255,255,.035);
    color: currentColor;
    font-size: .68rem;
}
.log-type-nav > a.active .log-type-icon { background: rgba(213,170,72,.14); }
.log-type-nav strong, .log-type-nav small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-type-nav strong { font-size: .72rem; }
.log-type-nav small { margin-top: .06rem; color: #67645d; font-size: .58rem; }
.log-total {
    display: grid;
    min-width: 7.5rem;
    padding: .8rem 1rem;
    border: 1px solid var(--border);
    border-radius: .8rem;
    background: rgba(213,170,72,.055);
    text-align: right;
}
.log-total strong { color: var(--gold-light); font: 700 1.35rem/1 Georgia,serif; }
.log-total span { margin-top: .22rem; color: var(--muted); font-size: .65rem; }
.filter-panel { margin-bottom: .8rem; padding: .9rem; }
.log-filters {
    display: grid;
    grid-template-columns: minmax(190px,1.7fr) minmax(145px,.85fr) minmax(125px,.65fr) minmax(125px,.65fr) auto;
    align-items: end;
    gap: .65rem;
}
.log-filters label { display: grid; gap: .3rem; }
.log-filters label > span { color: var(--muted); font-size: .68rem; font-weight: 750; }
.log-filters input, .log-filters select {
    width: 100%;
    min-height: 2.55rem;
    border: 1px solid var(--border-soft);
    border-radius: .6rem;
    outline: 0;
    background: #0b0b0a;
    padding: .55rem .65rem;
    color: var(--text);
    font: inherit;
    font-size: .77rem;
}
.log-filters input:focus, .log-filters select:focus {
    border-color: rgba(213,170,72,.55);
    box-shadow: 0 0 0 3px rgba(213,170,72,.07);
}
.filter-actions { display: flex; align-items: center; gap: .55rem; min-height: 2.55rem; }
.filter-actions a { color: var(--muted); font-size: .7rem; text-decoration: none; }
.filter-actions a:hover { color: var(--gold-light); }
.filter-button {
    min-height: 2.55rem;
    border: 0;
    border-radius: .6rem;
    background: linear-gradient(135deg,#d5aa48,#aa781a);
    padding: .55rem .8rem;
    color: #171105;
    cursor: pointer;
    font-weight: 850;
    font-size: .76rem;
}
.inline-alert {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .8rem;
    padding: .8rem 1rem;
    border: 1px solid rgba(240,92,92,.25);
    border-radius: .75rem;
    background: rgba(240,92,92,.07);
    color: #e9b4b4;
    font-size: .78rem;
}
.inline-alert.success { border-color: rgba(67,204,122,.25); background: rgba(67,204,122,.07); color: #b9e7c9; }
.inline-alert.warning { border-color: rgba(245,158,66,.25); background: rgba(245,158,66,.07); color: #ebc89f; }

.streaming-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    align-items: start;
    gap: .8rem;
}
.streaming-heading-actions { display: flex; align-items: center; gap: .55rem; }
.streaming-open-modal {
    display: inline-flex;
    min-height: 3.35rem;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    border: 1px solid rgba(213,170,72,.3);
    border-radius: .8rem;
    background: linear-gradient(135deg,rgba(213,170,72,.11),rgba(213,170,72,.035)),#11110f;
    padding: .55rem .85rem .55rem .58rem;
    color: var(--gold-light);
    cursor: pointer;
    font-size: .72rem;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: inset 0 1px rgba(255,255,255,.025),0 10px 28px rgba(0,0,0,.16);
    transition: border-color 150ms ease,background 150ms ease,transform 150ms ease;
}
.streaming-open-modal:hover { border-color: rgba(213,170,72,.55); background: linear-gradient(135deg,rgba(213,170,72,.17),rgba(213,170,72,.055)),#11110f; transform: translateY(-1px); }
.streaming-open-icon {
    display: grid;
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 2.15rem;
    place-items: center;
    border-radius: .62rem;
    background: linear-gradient(135deg,#d5aa48,#a9771b);
    color: #171105;
    font-size: 1rem;
    font-weight: 950;
    box-shadow: 0 7px 18px rgba(170,120,26,.18);
}
.streaming-form-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid rgba(240,92,92,.22);
    border-radius: .6rem;
    background: rgba(240,92,92,.07);
    color: #ff7373;
    font-size: .72rem;
}
.streaming-form { display: grid; gap: .9rem; }
.streaming-form label { display: grid; gap: .32rem; }
.streaming-form label > span { color: #d5d0c5; font-size: .72rem; font-weight: 780; }
.streaming-form label > small { color: #706d66; font-size: .62rem; line-height: 1.45; }
.streaming-form input, .streaming-form select, .streaming-form textarea {
    width: 100%;
    min-height: 2.65rem;
    border: 1px solid var(--border-soft);
    border-radius: .62rem;
    outline: 0;
    background: #0a0a09;
    padding: .6rem .68rem;
    color: var(--text);
    font: inherit;
    font-size: .76rem;
}
.streaming-form textarea { resize: vertical; line-height: 1.5; }
.streaming-form input:focus, .streaming-form select:focus, .streaming-form textarea:focus { border-color: rgba(213,170,72,.55); box-shadow: 0 0 0 3px rgba(213,170,72,.07); }
.streaming-submit {
    display: inline-flex;
    min-height: 2.7rem;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    border: 0;
    border-radius: .65rem;
    background: linear-gradient(135deg,#d5aa48,#aa781a);
    padding: .62rem .85rem;
    color: #171105;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 900;
}
.streaming-submit:hover { filter: brightness(1.08); }
.streaming-submit:disabled { cursor: wait; filter: saturate(.45); opacity: .72; }
.modal-open { overflow: hidden; }
.streaming-modal {
    width: min(33rem,calc(100% - 1.5rem));
    max-height: min(90vh,46rem);
    overflow: visible;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--text);
}
.streaming-modal::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.streaming-modal-card {
    overflow: hidden;
    gap: 0;
    border: 1px solid rgba(213,170,72,.28);
    border-radius: 1rem;
    background: linear-gradient(145deg,rgba(213,170,72,.07),transparent 35%),#11110f;
    box-shadow: 0 28px 90px rgba(0,0,0,.7);
}
.streaming-modal-header {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-soft);
}
.streaming-modal-header h2 { margin: .1rem 0 0; font-size: 1.35rem; }
.streaming-modal-close {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: .55rem;
    background: rgba(255,255,255,.02);
    color: #858178;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
}
.streaming-modal-close:hover { border-color: rgba(240,92,92,.3); color: #f07a7a; }
.streaming-modal-body { display: grid; gap: .95rem; padding: 1.1rem; }
.streaming-label-with-help { display: flex; align-items: center; gap: .38rem; }
.field-help {
    display: inline-grid;
    width: 1.15rem;
    height: 1.15rem;
    place-items: center;
    border: 1px solid rgba(91,143,249,.32);
    border-radius: 50%;
    background: rgba(91,143,249,.08);
    color: #8eb4ff;
    font-size: .62rem;
    font-weight: 900;
    text-decoration: none;
}
.field-help:hover { border-color: rgba(91,143,249,.7); background: rgba(91,143,249,.15); color: #c5d8ff; }
.streaming-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    padding: .9rem 1.1rem 1.05rem;
    border-top: 1px solid var(--border-soft);
}
.streaming-modal-actions .streaming-submit { min-width: 11rem; }
.streaming-cancel {
    min-height: 2.7rem;
    border: 1px solid var(--border-soft);
    border-radius: .65rem;
    background: rgba(255,255,255,.025);
    padding: .62rem .85rem;
    color: #9b978e;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 800;
}
.streaming-cancel:hover { color: var(--text); }
.streamer-list { display: grid; gap: .55rem; }
.streamer-item {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .72rem;
    border: 1px solid var(--border-soft);
    border-radius: .75rem;
    background: rgba(255,255,255,.016);
}
.streamer-item:hover { border-color: rgba(213,170,72,.17); background: rgba(213,170,72,.025); }
.streamer-avatar, .streamer-avatar img {
    width: 3rem;
    height: 3rem;
    border-radius: .72rem;
}
.streamer-avatar { display: grid; place-items: center; overflow: hidden; background: rgba(240,92,92,.08); color: #ff7373; }
.streamer-avatar img { object-fit: cover; }
.streamer-info { min-width: 0; }
.streamer-info > a, .streamer-info > strong { display: block; overflow: hidden; color: #ebe6da; font-size: .82rem; font-weight: 850; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.streamer-info > a:hover { color: var(--gold-light); }
.streamer-info > small { display: block; margin-top: .18rem; color: #67645d; font-size: .59rem; }
.streamer-meta { display: flex; min-width: 0; align-items: center; gap: .18rem; color: #89857c; font-size: .62rem; }
.streamer-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.streamer-delete-form { margin: 0; }
.streamer-delete {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid rgba(240,92,92,.18);
    border-radius: .58rem;
    background: rgba(240,92,92,.045);
    color: #a95b5b;
    cursor: pointer;
    font-size: .7rem;
}
.streamer-delete:hover { border-color: rgba(240,92,92,.42); background: rgba(240,92,92,.11); color: #ff7777; }

.tutorial-heading { align-items: center; }
.tutorial-back {
    border: 1px solid var(--border-soft);
    border-radius: .65rem;
    background: rgba(255,255,255,.025);
    padding: .55rem .75rem;
    color: #bbb7ad;
    font-size: .72rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
.tutorial-back:hover { border-color: var(--border); color: var(--gold-light); }
.tutorial-intro {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: .8rem;
    border-color: rgba(91,143,249,.18);
    background: linear-gradient(110deg,rgba(91,143,249,.075),transparent 45%),var(--surface);
}
.tutorial-intro-icon {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 2.8rem;
    place-items: center;
    border-radius: .75rem;
    background: rgba(91,143,249,.11);
    color: #8eb4ff;
    font-size: 1.2rem;
    font-weight: 900;
}
.tutorial-intro strong { color: #e7e2d7; font-size: .86rem; }
.tutorial-intro p { margin: .22rem 0 0; color: #8e8a82; font-size: .72rem; }
.tutorial-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.tutorial-card > header { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.tutorial-card > header > span {
    display: grid;
    width: 2.45rem;
    height: 2.45rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: .68rem;
    background: rgba(213,170,72,.065);
    color: var(--gold-light);
    font-size: 1rem;
}
.tutorial-card h2 { margin: .1rem 0 0; font-size: 1.25rem; }
.tutorial-card .card-kicker { margin: 0; font-size: .62rem; }
.tutorial-steps { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.tutorial-steps li { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .62rem; padding: .7rem; border: 1px solid var(--border-soft); border-radius: .68rem; background: rgba(255,255,255,.014); }
.tutorial-steps li > span { display: grid; width: 1.45rem; height: 1.45rem; place-items: center; border-radius: 50%; background: rgba(213,170,72,.11); color: var(--gold-light); font-size: .62rem; font-weight: 900; }
.tutorial-steps strong { display: block; color: #dcd7cc; font-size: .74rem; }
.tutorial-steps p { margin: .12rem 0 0; color: #7d7971; font-size: .66rem; line-height: 1.48; }
.tutorial-finish { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .8rem; }
.tutorial-finish > div { display: flex; align-items: center; gap: .65rem; }
.tutorial-finish > div > span { display: grid; width: 2rem; height: 2rem; flex: 0 0 2rem; place-items: center; border-radius: 50%; background: rgba(67,204,122,.11); color: var(--green); font-weight: 900; }
.tutorial-finish strong { font-size: .8rem; }
.tutorial-finish p { margin: .1rem 0 0; color: #77736b; font-size: .66rem; }
.tutorial-finish > a { color: var(--gold-light); font-size: .68rem; font-weight: 800; text-decoration: none; white-space: nowrap; }

.config-data-panel { padding: 0; }
.config-panel-heading { margin: 0; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border-soft); }
.config-category { display: inline-flex; border-radius: 999px; background: rgba(91,143,249,.07); padding: .23rem .43rem; color: #9dbaff; font-size: .62rem; font-weight: 800; }
.config-edit-button {
    min-height: 2rem;
    border: 1px solid rgba(213,170,72,.22);
    border-radius: .52rem;
    background: rgba(213,170,72,.055);
    padding: .4rem .62rem;
    color: var(--gold-light);
    cursor: pointer;
    font-size: .64rem;
    font-weight: 850;
}
.config-edit-button:hover { border-color: rgba(213,170,72,.45); background: rgba(213,170,72,.1); }
.config-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.config-primary-button {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid rgba(213,170,72,.28);
    border-radius: .65rem;
    background: rgba(213,170,72,.08);
    padding: .55rem .72rem;
    color: var(--gold-light);
    cursor: pointer;
    font-size: .7rem;
    font-weight: 900;
}
.config-primary-button span { display: grid; width: 1.3rem; height: 1.3rem; place-items: center; border-radius: .38rem; background: var(--gold); color: #171105; }
.constitution-limit-note { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; padding: .7rem .8rem; border: 1px solid rgba(91,143,249,.17); border-radius: .68rem; background: rgba(91,143,249,.045); color: #9fb9ec; font-size: .65rem; }
.constitution-limit-note span { color: #777b85; }
.constitution-page-list { display: grid; gap: .55rem; }
.constitution-page-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .75rem; padding: .8rem; border: 1px solid var(--border-soft); border-radius: .75rem; background: rgba(255,255,255,.015); }
.constitution-page-item.inactive { opacity: .68; }
.constitution-page-number { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: .68rem; background: rgba(213,170,72,.09); color: var(--gold-light); font: 800 1rem/1 Georgia,serif; }
.constitution-page-copy { min-width: 0; }
.constitution-page-copy > div { display: flex; align-items: center; gap: .45rem; }
.constitution-page-copy strong { overflow: hidden; color: #ded9ce; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.constitution-page-copy p { display: -webkit-box; margin: .2rem 0; overflow: hidden; color: #817d75; font-size: .66rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.constitution-page-copy small { color: #625f59; font-size: .58rem; }
.constitution-modal { width: min(43rem,calc(100% - 1.5rem)); }
.constitution-modal .streaming-modal-card { max-height: min(92vh,52rem); overflow-y: auto; }
.constitution-counter { text-align: right; }
.constitution-counter b { color: var(--gold-light); }

.config-module-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .45rem; margin-bottom: .8rem; }
.config-module-nav > a { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .45rem; min-width: 0; padding: .55rem .6rem; border: 1px solid var(--border-soft); border-radius: .62rem; background: rgba(255,255,255,.014); color: #8a867e; text-decoration: none; }
.config-module-nav > a:hover { border-color: rgba(213,170,72,.2); color: #d6d1c6; }
.config-module-nav > a.active { border-color: rgba(213,170,72,.34); background: rgba(213,170,72,.08); color: var(--gold-light); }
.config-module-nav > a > span { display: grid; width: 1.45rem; height: 1.45rem; place-items: center; border-radius: .4rem; background: rgba(255,255,255,.035); font-size: .65rem; }
.config-module-nav strong { overflow: hidden; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.config-module-nav small { display: grid; min-width: 1.25rem; height: 1.25rem; place-items: center; border-radius: 999px; background: rgba(255,255,255,.035); color: #716e66; font-size: .54rem; }
.config-module-panel .panel-heading { align-items: flex-start; }
.config-module-panel .panel-heading p { max-width: 620px; margin: .25rem 0 0; color: #77736c; font-size: .68rem; }
.config-cache-note { display: flex; align-items: flex-start; gap: .55rem; margin-bottom: .8rem; padding: .68rem .75rem; border: 1px solid rgba(245,158,66,.15); border-radius: .65rem; background: rgba(245,158,66,.035); color: var(--orange); }
.config-cache-note p { margin: 0; color: #8c7d6d; font-size: .64rem; }
.module-config-list { display: grid; gap: .55rem; }
.module-config-item { display: grid; gap: .35rem; padding: .78rem; border: 1px solid var(--border-soft); border-radius: .72rem; background: rgba(255,255,255,.014); }
.module-config-item.readonly { background: rgba(91,143,249,.018); }
.module-config-title { display: flex; align-items: center; gap: .45rem; }
.module-config-title code { border: 0; background: transparent; padding: 0; color: #ddd8cd; font-size: .7rem; font-weight: 850; }
.module-config-item > p { margin: 0; color: #77736c; font-size: .63rem; }
.module-config-item > small { color: #5f5c56; font-size: .56rem; }
.module-config-control { display: flex; align-items: stretch; gap: .5rem; }
.module-config-control input, .module-config-control select, .config-readonly-value { width: 100%; min-width: 0; min-height: 2.45rem; border: 1px solid var(--border-soft); border-radius: .58rem; outline: 0; background: #0a0a09; padding: .52rem .62rem; color: #d7d2c7; font: inherit; font-size: .7rem; }
.module-config-control input:focus, .module-config-control select:focus { border-color: rgba(213,170,72,.5); box-shadow: 0 0 0 3px rgba(213,170,72,.06); }
.module-config-control button { min-width: 5rem; border: 0; border-radius: .58rem; background: linear-gradient(135deg,#d5aa48,#a9771b); padding: .5rem .7rem; color: #171105; cursor: pointer; font-size: .66rem; font-weight: 900; }
.config-readonly-value { display: flex; align-items: center; color: #767d89; }
.data-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.logs-table { width: 100%; border-collapse: collapse; font-size: .73rem; }
.logs-table th {
    padding: .75rem .8rem;
    border-bottom: 1px solid var(--border);
    background: rgba(213,170,72,.035);
    color: #8f8b82;
    text-align: left;
    font-size: .64rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}
.logs-table td {
    max-width: 280px;
    padding: .78rem .8rem;
    border-bottom: 1px solid var(--border-soft);
    color: #bcb8ae;
    vertical-align: middle;
}
.logs-table tbody tr:last-child td { border-bottom: 0; }
.logs-table tbody tr:hover td { background: rgba(255,255,255,.012); }
.logs-table time, .logs-table td { white-space: nowrap; }
.cell-main, .logs-table small { display: block; }
.cell-main { overflow: hidden; max-width: 240px; color: #e2ded4; text-overflow: ellipsis; }
.logs-table small { max-width: 240px; margin-top: .14rem; overflow: hidden; color: #706d66; font-size: .62rem; text-overflow: ellipsis; }
.discord-id-line {
    display: flex;
    max-width: 100%;
    align-items: center;
    gap: .18rem;
    white-space: nowrap;
}
.discord-id-line > :first-child { min-width: 0; }
.copy-discord-button {
    display: inline-grid;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    place-items: center;
    border: 0;
    border-radius: .25rem;
    background: transparent;
    padding: 0;
    color: #6f6b63;
    cursor: pointer;
    font-size: .58rem;
    line-height: 1;
}
.copy-discord-button:hover { background: rgba(213,170,72,.08); color: var(--gold-light); }
.copy-discord-button.copied { background: rgba(67,204,122,.08); color: var(--green); }
.copy-discord-button.copy-error { color: var(--red); }
.copy-discord-button:disabled { cursor: default; }
.phone-value { color: #ded9ce; font-weight: 730; }
.event-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: .25rem .45rem;
    font-size: .58rem;
    font-weight: 850;
    line-height: 1;
    opacity: .9;
}
.event-pill.success { color: var(--green); background: rgba(67,204,122,.06); }
.event-pill.danger { color: var(--red); background: rgba(240,92,92,.06); }
.event-pill.warning { color: var(--orange); background: rgba(245,158,66,.06); }
.event-pill.neutral { color: var(--gold-light); background: rgba(213,170,72,.055); }
.log-details summary { color: var(--gold-light); cursor: pointer; font-size: .67rem; font-weight: 750; }
.log-details pre {
    width: min(480px,65vw);
    max-height: 260px;
    margin: .55rem 0 0;
    overflow: auto;
    border: 1px solid var(--border-soft);
    border-radius: .55rem;
    background: #080808;
    padding: .65rem;
    color: #b8b4aa;
    font: .66rem/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;
    white-space: pre-wrap;
}
.muted-value { color: #66635d; }
.table-empty { padding: 3.5rem 1rem; color: #77736c; text-align: center; }
.table-empty span, .table-empty strong { display: block; }
.table-empty span { color: var(--gold); font-size: 2rem; }
.table-empty strong { margin-top: .5rem; color: #bab6ac; font-family: Georgia,serif; font-size: 1rem; }
.table-empty p { margin: .25rem 0 0; font-size: .72rem; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: .68rem;
}
.pagination a { border: 1px solid var(--border-soft); border-radius: .55rem; padding: .45rem .65rem; color: #c6c1b7; text-decoration: none; }
.pagination a:hover { border-color: var(--border); color: var(--gold-light); }
.pagination a.disabled { opacity: .35; pointer-events: none; }

.footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--border-soft); color: #706d66; font-size: .72rem; }

@media (max-width: 900px) {
    .login-layout { grid-template-columns: 1fr; min-height: auto; }
    .visual-card { display: none; }
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .content-grid { grid-template-columns: 1fr; }
    .log-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .filter-search { grid-column: 1 / -1; }
    .filter-actions { justify-content: flex-end; }
    .streaming-layout { grid-template-columns: 1fr; }
    .tutorial-grid { grid-template-columns: 1fr; }
    .config-module-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .logs-page .log-type-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
    .page-shell { width: min(100% - 1rem,1180px); padding-top: .8rem; }
    .topbar { align-items: flex-start; }
    .brand small, .topnav > a, .account-chip span { display: none; }
    .menu-toggle { display: inline-flex; }
    .admin-layout { display: block; }
    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(82vw,280px);
        min-height: 100vh;
        border-width: 0 1px 0 0;
        border-radius: 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }
    .sidebar-open .admin-sidebar { transform: translateX(0); }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 15;
        border: 0;
        background: rgba(0,0,0,.68);
    }
    .sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-open { overflow: hidden; }
    .login-layout { padding: 2rem 1.25rem; border-radius: 1rem; }
    .login-copy h1 { font-size: 2.65rem; }
    .dashboard-heading { align-items: flex-start; flex-direction: column; }
    .streaming-heading-actions { width: 100%; }
    .streaming-open-modal { flex: 1; }
    .health-card { grid-template-columns: auto 1fr; }
    .health-time { grid-column: 1 / -1; padding: .8rem 0 0; border-top: 1px solid var(--border-soft); border-left: 0; text-align: left; }
    .module-grid { grid-template-columns: 1fr; }
    .logs-heading { flex-direction: row; align-items: flex-end; }
    .log-type-nav { display: flex; overflow-x: auto; scrollbar-width: thin; }
    .log-type-nav > a { min-width: 10.5rem; flex: 1 0 10.5rem; }
    .log-total { min-width: 6rem; }
    .log-filters { grid-template-columns: 1fr; }
    .filter-search { grid-column: auto; }
    .filter-actions { justify-content: stretch; }
    .filter-button { flex: 1; }
    .logs-table, .logs-table tbody, .logs-table tr, .logs-table td { display: block; width: 100%; }
    .logs-table thead { display: none; }
    .logs-table tr { padding: .65rem; border-bottom: 1px solid var(--border-soft); }
    .logs-table tr:last-child { border-bottom: 0; }
    .logs-table td {
        display: grid;
        max-width: none;
        grid-template-columns: 7rem minmax(0,1fr);
        gap: .7rem;
        padding: .42rem .3rem;
        border: 0;
        white-space: normal;
    }
    .logs-table td::before { color: #716e66; content: attr(data-label); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
    .cell-main, .logs-table small { max-width: none; }
    .log-details pre { width: 100%; }
    .pagination { flex-wrap: wrap; }
    .streamer-item { grid-template-columns: auto minmax(0,1fr) auto; }
    .streaming-modal-actions { align-items: stretch; flex-direction: column-reverse; }
    .streaming-modal-actions .streaming-submit { width: 100%; }
    .tutorial-finish { align-items: flex-start; flex-direction: column; }
    .tutorial-finish > a { white-space: normal; }
    .config-form-grid { grid-template-columns: 1fr; }
    .constitution-limit-note { align-items: flex-start; flex-direction: column; }
    .constitution-page-item { grid-template-columns: auto minmax(0,1fr); }
    .constitution-page-item > .config-edit-button { grid-column: 1 / -1; }
    .config-module-nav { display: flex; overflow-x: auto; }
    .config-module-nav > a { min-width: 9rem; flex: 1 0 9rem; }
    .module-config-control { align-items: stretch; flex-direction: column; }
    .module-config-control button { min-height: 2.4rem; }
    .footer { flex-direction: column; }
}
