:root {
    color-scheme: dark;
    --bg: #070910;
    --surface: #0d111c;
    --surface-2: #121827;
    --surface-3: #171e30;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .13);
    --text: #f3f5fb;
    --muted: #8992a6;
    --muted-2: #626b7e;
    --violet: #8068ff;
    --violet-2: #a895ff;
    --blue: #4a9eff;
    --green: #3ddc97;
    --danger: #ff6f7d;
    --shadow: 0 30px 80px rgba(0, 0, 0, .38);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background:
    radial-gradient(circle at 15% 12%, rgba(100, 80, 255, .11), transparent 28%),
    radial-gradient(circle at 92% 88%, rgba(42, 115, 255, .08), transparent 28%),
    var(--bg); overflow-x: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
.is-booting { overflow: hidden; }
.is-booting .auth-layout, .is-booting .app-shell { visibility: hidden; }
.boot-screen { position: fixed; z-index: 200; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px; background:
    radial-gradient(circle at 50% 42%, rgba(128,104,255,.12), transparent 28%),
    #070910; }
.boot-spinner { width: 27px; height: 27px; border: 2px solid rgba(128,104,255,.16); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }

.ambient { position: fixed; width: 360px; height: 360px; border-radius: 50%; filter: blur(120px); pointer-events: none; opacity: .13; }
.ambient-one { top: -190px; left: -120px; background: var(--violet); }
.ambient-two { right: -190px; bottom: -190px; background: var(--blue); }
.eyebrow { margin: 0 0 12px; color: var(--violet-2); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 800; letter-spacing: .18em; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(167, 149, 255, .35); border-radius: 12px; background: linear-gradient(145deg, rgba(129, 104, 255, .32), rgba(129, 104, 255, .08)); box-shadow: inset 0 0 20px rgba(129, 104, 255, .12), 0 10px 25px rgba(0, 0, 0, .2); }
.brand-mark span { color: #c5b9ff; font-size: 18px; font-weight: 900; letter-spacing: 0; }

.auth-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr); min-height: 100vh; }
.auth-showcase { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 46px clamp(42px, 6vw, 92px); overflow: hidden; border-right: 1px solid var(--line); background:
    linear-gradient(125deg, rgba(11, 14, 25, .72), rgba(8, 10, 17, .97)),
    repeating-linear-gradient(90deg, transparent 0, transparent 59px, rgba(255,255,255,.026) 60px),
    repeating-linear-gradient(0deg, transparent 0, transparent 59px, rgba(255,255,255,.026) 60px); }
.auth-showcase::after { content: ""; position: absolute; width: 540px; height: 540px; right: -140px; bottom: -210px; border: 1px solid rgba(133,111,255,.13); border-radius: 50%; box-shadow: 0 0 0 80px rgba(133,111,255,.018), 0 0 0 160px rgba(133,111,255,.012); }
.showcase-top { display: flex; align-items: center; justify-content: space-between; }
.secure-pill, .live-badge { display: inline-flex; align-items: center; gap: 8px; color: #aeb6c7; font-size: 12px; }
.secure-pill i, .live-badge i, .connection i, .user-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px rgba(61, 220, 151, .65); }
.showcase-copy { position: relative; z-index: 1; max-width: 690px; margin: auto 0; padding: 70px 0 45px; }
.showcase-copy h1 { margin: 0; font-size: clamp(52px, 6.2vw, 96px); font-weight: 650; letter-spacing: -.065em; line-height: .98; }
.showcase-copy h1 span { color: #7f8798; }
.showcase-copy > p:last-child { max-width: 520px; margin: 30px 0 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.7; }
.showcase-metrics { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 18px; }
.mini-chart { width: min(430px, 72%); padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: rgba(14, 18, 30, .72); backdrop-filter: blur(18px); }
.chart-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.chart-head strong { color: var(--green); }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); height: 72px; gap: 8px; margin-top: 15px; }
.bar-column { position: relative; min-width: 0; height: 72px; }
.bar-column i { position: absolute; right: 0; bottom: 18px; left: 0; display: block; min-height: 5px; border-radius: 4px 4px 2px 2px; background: linear-gradient(to top, rgba(128, 104, 255, .22), #8068ff); }
.bar-column span { position: absolute; right: 0; bottom: 0; left: 0; overflow: hidden; color: #626b7e; font-size: 8px; font-weight: 700; line-height: 12px; text-align: center; text-transform: uppercase; }
.metric-orb { display: grid; min-width: 124px; height: 124px; align-content: center; justify-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(14, 18, 30, .78); box-shadow: inset 0 0 38px rgba(128,104,255,.08); }
.orb-dot { width: 8px; height: 8px; margin-bottom: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px rgba(61,220,151,.7); }
.metric-orb small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.metric-orb strong { margin-top: 4px; font-size: 15px; }

.auth-panel { display: grid; min-height: 100vh; place-items: center; padding: 50px clamp(28px, 5vw, 82px); background: rgba(7, 9, 16, .6); }
.auth-box { width: min(100%, 430px); }
.mobile-brand { display: none; }
.auth-heading { margin-bottom: 42px; }
.auth-heading h2 { margin: 0 0 13px; font-size: 37px; letter-spacing: -.04em; }
.auth-heading > p:last-child { margin: 0; color: var(--muted); font-size: 15px; }
.auth-box label { display: block; margin: 0 0 9px; color: #bac1d0; font-size: 13px; font-weight: 650; }
.input-wrap { position: relative; margin-bottom: 22px; }
.input-wrap input { width: 100%; height: 57px; padding: 0 48px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 13px; outline: none; background: rgba(17, 22, 35, .82); transition: border .2s, box-shadow .2s, background .2s; }
.input-wrap input::placeholder { color: #5f687a; }
.input-wrap input:focus { border-color: rgba(128,104,255,.72); background: #121726; box-shadow: 0 0 0 4px rgba(128,104,255,.1); }
.input-icon { position: absolute; z-index: 1; top: 50%; left: 18px; width: 16px; height: 18px; color: #697286; transform: translateY(-50%); pointer-events: none; }
.user-icon::before { content: ""; position: absolute; top: 1px; left: 5px; width: 6px; height: 6px; border: 1.4px solid currentColor; border-radius: 50%; }
.user-icon::after { content: ""; position: absolute; bottom: 1px; left: 2px; width: 12px; height: 7px; border: 1.4px solid currentColor; border-bottom: 0; border-radius: 8px 8px 2px 2px; }
.input-icon.lock { width: 14px; height: 12px; border: 1.4px solid currentColor; border-radius: 3px; }
.input-icon.lock::before { content: ""; position: absolute; width: 8px; height: 8px; left: 1.6px; top: -8px; border: 1.4px solid currentColor; border-bottom: 0; border-radius: 7px 7px 0 0; }
.input-icon.lock::after { content: ""; position: absolute; top: 4px; left: 5px; width: 2px; height: 4px; border-radius: 2px; background: currentColor; opacity: .85; }
.ghost-icon { position: absolute; top: 50%; right: 11px; width: 38px; height: 38px; padding: 0; color: #70798b; border: 0; background: transparent; cursor: pointer; transform: translateY(-50%); }
.ghost-icon::before { content: ""; position: absolute; top: 13px; left: 10px; width: 16px; height: 10px; border: 1.4px solid currentColor; border-radius: 50% / 58%; transition: border-color .2s; }
.ghost-icon::after { content: ""; position: absolute; top: 17px; left: 16px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0; transform: scale(.55); transition: opacity .18s, transform .18s; }
.ghost-icon.is-visible { color: #a99cff; }
.ghost-icon.is-visible::after { opacity: 1; transform: scale(1); }
.form-message { min-height: 20px; margin: -7px 0 12px; color: var(--danger); font-size: 13px; line-height: 1.45; }
.primary-button, .secondary-button { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 13px; font-weight: 750; cursor: pointer; transition: transform .2s, filter .2s, opacity .2s; }
.primary-button { color: white; background: linear-gradient(135deg, #755dff, #8b72ff); box-shadow: 0 14px 34px rgba(116,91,255,.24); }
.primary-button b { font-size: 19px; font-weight: 500; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { opacity: .68; cursor: wait; }
.primary-button.loading span::after { content: "…"; }
.auth-foot { margin: 24px 0 0; color: #555e70; font-size: 11px; text-align: center; }

.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { position: sticky; z-index: 30; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 30px 18px 22px; border-right: 1px solid var(--line); background: rgba(9,12,20,.94); backdrop-filter: blur(22px); }
.sidebar-brand { padding: 0 12px 36px; }
.main-nav > p { margin: 0 13px 12px; color: #4f586b; font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.nav-item { display: flex; width: 100%; min-height: 48px; align-items: center; gap: 13px; margin: 4px 0; padding: 0 14px; color: #7f899d; border: 1px solid transparent; border-radius: 11px; background: transparent; font-size: 13px; font-weight: 650; text-align: left; cursor: pointer; transition: .18s ease; }
.nav-item:hover { color: #cdd3df; background: rgba(255,255,255,.035); }
.nav-item.active { color: #eeeaff; border-color: rgba(130,108,255,.18); background: linear-gradient(100deg, rgba(128,104,255,.18), rgba(128,104,255,.05)); }
.nav-item.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 25px; border-radius: 0 3px 3px 0; background: var(--violet); box-shadow: 0 0 15px rgba(128,104,255,.55); }
.nav-icon { display: grid; width: 22px; place-items: center; color: inherit; font-size: 17px; }
.sidebar-bottom { margin-top: auto; }
.connection { display: flex; align-items: center; gap: 9px; margin: 0 13px 17px; color: #626c7d; font-size: 10px; }
.connection i { width: 6px; height: 6px; }
.logout { border-top: 1px solid var(--line); border-radius: 0; padding-top: 13px; }
.sidebar-backdrop { display: none; }
.workspace { min-width: 0; }
.topbar { display: flex; height: 96px; align-items: center; justify-content: space-between; padding: 0 clamp(24px,4vw,56px); border-bottom: 1px solid var(--line); background: rgba(8,11,18,.72); backdrop-filter: blur(18px); }
.topbar .eyebrow { margin-bottom: 5px; font-size: 9px; }
.topbar h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.menu-button { display: none; border: 0; background: transparent; font-size: 21px; cursor: pointer; }
.profile { display: flex; align-items: center; gap: 12px; }
.profile-copy { display: grid; justify-items: end; gap: 3px; }
.profile-copy strong { font-size: 13px; }
.profile-copy span { color: var(--muted); font-size: 10px; }
.avatar { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid rgba(128,104,255,.32); border-radius: 12px; color: #c8beff; background: rgba(128,104,255,.13); font-size: 14px; font-weight: 800; }
.avatar.has-image { overflow: hidden; padding: 0; }
.avatar.has-image img { width: 100%; height: 100%; object-fit: cover; }
.content { width: min(1420px, 100%); margin: 0 auto; padding: clamp(30px, 4vw, 56px); }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 35px; }
.welcome-row h1 { margin: 0 0 11px; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.05em; }
.welcome-row > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.live-badge, .count-badge { flex: 0 0 auto; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(18,24,39,.65); font-size: 11px; }
.count-badge { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card { position: relative; display: flex; min-height: 155px; align-items: center; gap: 18px; padding: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(18,24,39,.96), rgba(13,17,28,.86)); box-shadow: 0 18px 45px rgba(0,0,0,.12); }
.stat-card::after { content: ""; position: absolute; width: 90px; height: 90px; top: -45px; right: -35px; border-radius: 50%; background: currentColor; filter: blur(42px); opacity: .16; }
.stat-icon { display: grid; width: 49px; height: 49px; flex: 0 0 auto; place-items: center; border: 1px solid currentColor; border-radius: 14px; background: color-mix(in srgb, currentColor 10%, transparent); font-size: 21px; }
.accent-violet { color: var(--violet-2); }
.accent-green { color: var(--green); }
.accent-blue { color: var(--blue); }
.stat-card > div:last-child { display: grid; }
.stat-card span { margin-bottom: 7px; color: #8e98aa; font-size: 12px; }
.stat-card strong { color: var(--text); font-size: 32px; letter-spacing: -.05em; }
.stat-card small { margin-top: 5px; color: #586175; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 16px; margin-top: 16px; }
.dashboard-grid.single-card { grid-template-columns: 1fr; }
.panel-card { border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(17,23,37,.93), rgba(12,16,27,.9)); }
.activity-card, .quick-card { min-height: 245px; padding: 27px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-card h3 { margin: 0; font-size: 18px; }
.status-chip { padding: 7px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; font-size: 10px; }
.status-chip.online { color: var(--green); border-color: rgba(61,220,151,.2); background: rgba(61,220,151,.06); }
.activity-visual { display: flex; align-items: center; gap: 24px; margin-top: 31px; }
.pulse-ring { display: grid; width: 82px; height: 82px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(128,104,255,.27); border-radius: 50%; box-shadow: 0 0 0 9px rgba(128,104,255,.04), 0 0 0 18px rgba(128,104,255,.018); }
.pulse-ring span { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; color: #c7bcff; background: linear-gradient(145deg, rgba(128,104,255,.27), rgba(128,104,255,.1)); font-weight: 800; }
.activity-visual strong { font-size: 17px; }
.activity-visual p { max-width: 470px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.quick-card .eyebrow { margin-bottom: 8px; }
.quick-link { display: flex; width: 100%; align-items: center; gap: 13px; margin-top: 12px; padding: 12px 14px; color: inherit; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); text-align: left; cursor: pointer; transition: .2s; }
.quick-card h3 + .quick-link { margin-top: 20px; }
.quick-link:hover { border-color: rgba(128,104,255,.28); background: rgba(128,104,255,.07); transform: translateY(-1px); }
.quick-link > span:nth-child(2) { display: grid; gap: 4px; flex: 1; }
.quick-link small { color: var(--muted); font-size: 10px; }
.quick-link b { color: var(--violet-2); font-weight: 500; }
.quick-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: var(--violet-2); background: rgba(128,104,255,.1); }
.table-card { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 690px; }
th, td { padding: 18px 22px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: #5f687b; background: rgba(255,255,255,.012); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
td { color: #929caf; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.015); }
.user-cell { display: flex; align-items: center; gap: 11px; color: var(--text); }
.user-cell > span { display: grid; width: 34px; height: 34px; overflow: hidden; place-items: center; border-radius: 10px; color: #c8bdff; background: rgba(128,104,255,.12); font-weight: 800; }
.user-cell > span.has-avatar { border: 1px solid rgba(128,104,255,.18); background: #101522; }
.user-cell > span img { width: 100%; height: 100%; object-fit: cover; }
.role-badge { display: inline-block; padding: 6px 9px; color: #b6aaff; border-radius: 7px; background: rgba(128,104,255,.09); font-size: 10px; }
.role-badge.role-creator { color: #ffd485; background: rgba(255,190,78,.09); }
.role-badge.role-admin { color: #a99cff; background: rgba(128,104,255,.1); }
.role-badge.role-user { color: #8fbef5; background: rgba(74,158,255,.08); }
.percent-value { color: #dbe0e9; font-size: 12px; }
.action-cell { width: 130px; text-align: right; }
.edit-user-button { padding: 8px 11px; color: #b9adff; border: 1px solid rgba(128,104,255,.18); border-radius: 8px; background: rgba(128,104,255,.07); font-size: 10px; font-weight: 700; cursor: pointer; transition: .18s; }
.edit-user-button:hover { border-color: rgba(128,104,255,.4); background: rgba(128,104,255,.13); }
.protected-label { color: #555e70; font-size: 9px; }
.user-list-actions { display: flex; align-items: center; gap: 10px; }
.add-user-button { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 0 14px; color: white; border: 0; border-radius: 10px; background: linear-gradient(135deg, #755dff, #8b72ff); box-shadow: 0 10px 24px rgba(116,91,255,.18); font-size: 11px; font-weight: 750; cursor: pointer; }
.add-user-button span { font-size: 15px; font-weight: 400; }
.add-user-button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.user-status { display: inline-flex; align-items: center; gap: 7px; }
.user-status i { background: #5c6577; box-shadow: none; }
.user-status.online { color: var(--green); }
.user-status.online i { background: var(--green); box-shadow: 0 0 10px rgba(61,220,151,.4); }
.loading-state, .error-state { display: grid; min-height: 420px; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.loading-state span { width: 32px; height: 32px; border: 2px solid rgba(128,104,255,.18); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-state p { font-size: 12px; }
.error-state > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; color: var(--danger); background: rgba(255,111,125,.08); font-weight: 800; }
.error-state h3 { margin: 16px 0 6px; color: var(--text); }
.error-state p { max-width: 440px; margin: 0 0 20px; font-size: 13px; }
.secondary-button { width: auto; min-height: 42px; padding: 0 18px; border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 12px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; padding: 13px 17px; color: #dfe4ed; border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(18,24,39,.96); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }

.modal-open { overflow: hidden; }
.modal { position: fixed; z-index: 150; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3,5,10,.76); backdrop-filter: blur(8px); animation: modal-fade .18s ease both; }
.modal-card { position: relative; width: min(100%, 560px); max-height: calc(100svh - 40px); overflow-y: auto; padding: 28px; border: 1px solid var(--line-strong); border-radius: 20px; background: linear-gradient(145deg, #121725, #0d111c); box-shadow: 0 34px 90px rgba(0,0,0,.55); animation: modal-in .22s ease both; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.modal-head .eyebrow { margin-bottom: 6px; font-size: 9px; }
.modal-head h3 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.modal-close { width: 34px; height: 34px; flex: 0 0 auto; padding: 0; color: #727c8f; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); font-size: 21px; line-height: 1; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; }
.full-field { grid-column: 1 / -1; }
.field label { display: block; margin: 0 0 8px; color: #afb7c7; font-size: 11px; font-weight: 700; }
.field input, .field select { width: 100%; height: 49px; padding: 0 14px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 11px; outline: none; background: #0d121e; transition: border .2s, box-shadow .2s; }
.field input:focus, .field select:focus { border-color: rgba(128,104,255,.65); box-shadow: 0 0 0 4px rgba(128,104,255,.08); }
.field input:read-only { color: #7c8597; cursor: not-allowed; }
.field select:disabled { color: #788194; cursor: not-allowed; }
.field small { display: block; margin-top: 6px; color: #596275; font-size: 9px; }
.percent-input { position: relative; }
.percent-input input { padding-right: 37px; }
.percent-input span { position: absolute; top: 50%; right: 14px; color: #737d90; font-size: 12px; transform: translateY(-50%); pointer-events: none; }
.modal-message { margin: 14px 0 0; }
.modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.modal-actions-right { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.modal-save { width: auto; min-width: 118px; min-height: 43px; padding: 0 18px; border-radius: 10px; font-size: 11px; }
.cancel-button, .danger-button { min-height: 43px; padding: 0 16px; border-radius: 10px; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.cancel-button { color: #8892a5; border: 1px solid var(--line); }
.danger-button { color: #ff8994; border: 1px solid rgba(255,111,125,.2); background: rgba(255,111,125,.055); }
.danger-button:disabled { opacity: .6; cursor: wait; }

.templates-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stream-template-card { --template-accent: #8068ff; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(145deg, rgba(17,23,37,.96), rgba(11,15,25,.94)); transition: border-color .22s, transform .22s, box-shadow .22s; }
.stream-template-card:hover { border-color: color-mix(in srgb, var(--template-accent) 38%, transparent); box-shadow: 0 24px 55px rgba(0,0,0,.2); transform: translateY(-3px); }
.accent-violet { --template-accent: #8068ff; }
.accent-blue { --template-accent: #4a9eff; }
.accent-green { --template-accent: #3ddc97; }
.accent-orange { --template-accent: #ff9f5a; }
.template-preview { position: relative; height: 180px; overflow: hidden; border-bottom: 1px solid var(--line); background:
    linear-gradient(135deg, color-mix(in srgb, var(--template-accent) 13%, transparent), transparent 58%),
    repeating-linear-gradient(90deg, transparent 0, transparent 39px, rgba(255,255,255,.018) 40px),
    #0a0e18; }
.template-preview::after { content: ""; position: absolute; width: 150px; height: 150px; top: -70px; right: -45px; border-radius: 50%; background: var(--template-accent); filter: blur(65px); opacity: .15; }
.template-image-preview::after { display: none; }
.template-image-preview { background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--template-accent) 10%, transparent), transparent 48%),
    #090d16; }
.stream-template-card .template-image-preview { height: 320px; }
.template-preview-backdrop { position: absolute; inset: -22px; width: calc(100% + 44px); height: calc(100% + 44px); object-fit: cover; filter: blur(22px) brightness(.32) saturate(.85); opacity: .62; transform: scale(1.05); }
.template-preview-full { position: absolute; z-index: 2; top: 50%; left: 50%; width: auto; max-width: 68%; height: 88%; object-fit: contain; object-position: center; border: 5px solid #171c27; border-radius: 14px; background: #090d16; box-shadow: 0 18px 48px rgba(0,0,0,.58), 0 0 0 1px rgba(255,255,255,.08); transform: translate(-50%, -50%); }
.template-preview span, .template-preview i, .template-preview b { position: absolute; display: block; border: 1px solid color-mix(in srgb, var(--template-accent) 31%, rgba(255,255,255,.08)); border-radius: 8px; background: rgba(14,19,31,.86); }
.preview-standard .preview-main { inset: 25px 116px 31px 25px; }
.preview-standard .preview-side { width: 70px; top: 25px; right: 25px; bottom: 72px; }
.preview-standard i { width: 70px; height: 31px; right: 25px; bottom: 31px; }
.preview-standard b { height: 5px; right: 134px; bottom: 18px; left: 25px; border: 0; background: var(--template-accent); opacity: .75; }
.preview-vertical .preview-main { width: 77px; top: 18px; bottom: 18px; left: 50%; border-radius: 12px; transform: translateX(-50%); }
.preview-vertical .preview-side { width: 47px; height: 69px; right: calc(50% - 120px); bottom: 26px; }
.preview-vertical i { width: 47px; height: 32px; left: calc(50% - 120px); top: 28px; }
.preview-vertical b { width: 42px; height: 5px; right: calc(50% - 117px); top: 32px; border: 0; background: var(--template-accent); }
.preview-gaming .preview-main { inset: 21px 25px 48px; }
.preview-gaming .preview-side { width: 84px; height: 45px; right: 36px; bottom: 27px; border-color: var(--template-accent); }
.preview-gaming i { width: 105px; height: 22px; left: 25px; bottom: 21px; }
.preview-gaming b { width: 7px; height: 7px; top: 31px; right: 35px; border: 0; border-radius: 50%; background: #ff6876; box-shadow: 0 0 12px rgba(255,104,118,.55); }
.preview-interview .preview-main { top: 27px; bottom: 38px; left: 25px; width: calc(50% - 31px); }
.preview-interview .preview-side { top: 27px; right: 25px; bottom: 38px; width: calc(50% - 31px); }
.preview-interview i, .preview-interview b { width: 30px; height: 30px; top: 50%; border-radius: 50%; transform: translateY(-65%); background: color-mix(in srgb, var(--template-accent) 16%, #111827); }
.preview-interview i { left: calc(25% - 3px); }
.preview-interview b { right: calc(25% - 3px); }
.template-card-body { padding: 22px; }
.template-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.template-status { display: inline-flex; align-items: center; gap: 7px; color: #7d8799; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.template-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--template-accent); box-shadow: 0 0 10px color-mix(in srgb, var(--template-accent) 70%, transparent); }
.template-status.maintenance { color: #ffc27d; }
.template-status.maintenance i { background: #ff9f5a; box-shadow: 0 0 10px rgba(255,159,90,.45); }
.template-number { color: #454e61; font-size: 10px; font-weight: 800; }
.template-card-body h3 { margin: 0 0 9px; font-size: 19px; letter-spacing: -.025em; }
.template-launch-button { display: flex; width: 100%; min-height: 43px; align-items: center; justify-content: space-between; margin-top: 20px; padding: 0 14px; color: #bdc4d1; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.022); font-size: 10px; font-weight: 700; cursor: pointer; transition: .18s; }
.template-launch-button:hover { color: white; border-color: color-mix(in srgb, var(--template-accent) 35%, transparent); background: color-mix(in srgb, var(--template-accent) 7%, transparent); }
.template-launch-button:disabled { color: #555e70; cursor: not-allowed; opacity: .72; }
.template-launch-button:disabled:hover { border-color: var(--line); background: rgba(255,255,255,.022); }
.template-launch-button b { color: var(--template-accent); font-size: 16px; font-weight: 500; }
.empty-library { grid-column: 1 / -1; display: grid; min-height: 330px; place-items: center; align-content: center; padding: 30px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--muted); text-align: center; }
.empty-library > span { color: var(--violet-2); font-size: 28px; }
.empty-library h3 { margin: 15px 0 5px; color: var(--text); }
.empty-library p { margin: 0; font-size: 12px; }

.history-card { min-height: 330px; }
.history-title { display: flex; align-items: center; gap: 11px; color: var(--text); }
.history-title > span { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--violet-2); background: rgba(128,104,255,.09); font-size: 10px; }
.history-title > div { display: grid; gap: 3px; }
.history-title small { color: #626b7e; font-size: 9px; font-weight: 400; }
.history-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 8px; font-size: 9px; font-weight: 700; }
.history-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.history-status.live { color: var(--green); background: rgba(61,220,151,.07); }
.history-status.completed { color: #8fbef5; background: rgba(74,158,255,.07); }
.history-status.interrupted { color: #ff8b96; background: rgba(255,111,125,.07); }
.history-empty { display: grid; min-height: 330px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.history-empty-icon { display: grid; width: 55px; height: 55px; place-items: center; border: 1px solid rgba(128,104,255,.17); border-radius: 16px; color: var(--violet-2); background: rgba(128,104,255,.07); font-size: 23px; }
.history-empty h3 { margin: 17px 0 7px; }
.history-empty p { max-width: 430px; margin: 0 0 21px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.creator-only-badge { padding: 9px 12px; color: #ffd18a; border: 1px solid rgba(255,190,78,.15); border-radius: 9px; background: rgba(255,190,78,.05); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.settings-head-actions { display: flex; align-items: center; gap: 10px; }
.settings-list { display: grid; gap: 15px; }
.template-setting-card { --template-accent: #8068ff; display: grid; grid-template-columns: 240px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(17,23,37,.95), rgba(12,16,27,.9)); }
.setting-preview { min-height: 255px; border-right: 1px solid var(--line); }
.setting-preview .template-preview { height: 100%; min-height: 255px; border-bottom: 0; }
.setting-fields { padding: 23px; }
.setting-title-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.setting-title-row > span { color: #596275; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.template-setting-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 8px; font-size: 9px; font-weight: 750; }
.template-setting-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.template-setting-status.status-active { color: var(--green); background: rgba(61,220,151,.07); }
.template-setting-status.status-disabled { color: #7b8598; background: rgba(123,133,152,.07); }
.template-setting-status.status-maintenance { color: #ffb46f; background: rgba(255,159,90,.07); }
.setting-fields > label { display: grid; gap: 7px; margin-top: 13px; color: #9ea7b8; font-size: 10px; font-weight: 700; }
.setting-fields input[type="text"], .setting-fields textarea { width: 100%; padding: 12px 13px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; outline: none; background: #0b101b; resize: vertical; transition: .18s; }
.setting-fields input[type="text"] { height: 43px; }
.setting-fields input:focus, .setting-fields textarea:focus { border-color: rgba(128,104,255,.58); box-shadow: 0 0 0 3px rgba(128,104,255,.07); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 31px; height: 18px; border-radius: 20px; background: #252c3a; transition: .2s; }
.switch i::after { content: ""; position: absolute; width: 12px; height: 12px; top: 3px; left: 3px; border-radius: 50%; background: #707a8d; transition: .2s; }
.switch input:checked + i { background: rgba(61,220,151,.18); }
.switch input:checked + i::after { left: 16px; background: var(--green); box-shadow: 0 0 10px rgba(61,220,151,.35); }
.switch b { color: #768093; font-size: 9px; font-weight: 700; }
.setting-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.setting-state { margin-right: auto; color: var(--green); font-size: 9px; }
.setting-state.error { color: var(--danger); }
.save-template-button { min-height: 38px; padding: 0 15px; color: #c8beff; border: 1px solid rgba(128,104,255,.2); border-radius: 9px; background: rgba(128,104,255,.08); font-size: 10px; font-weight: 750; cursor: pointer; }
.save-template-button:disabled { opacity: .55; cursor: wait; }
.template-action-button { min-height: 38px; padding: 0 12px; color: #909aad; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.022); font-size: 9px; font-weight: 700; cursor: pointer; }
.template-action-button.maintenance { color: #e7aa70; border-color: rgba(255,159,90,.15); background: rgba(255,159,90,.045); }
.template-action-button.danger { color: #eb7f8a; border-color: rgba(255,111,125,.15); background: rgba(255,111,125,.04); }
.template-action-button:disabled { opacity: .55; cursor: wait; }

.template-modal-card { width: min(100%, 520px); }
.image-upload { position: relative; display: grid; min-height: 210px; place-items: center; align-content: center; gap: 7px; overflow: hidden; padding: 25px; border: 1px dashed rgba(128,104,255,.3); border-radius: 14px; background: rgba(128,104,255,.035); text-align: center; cursor: pointer; transition: .2s; }
.image-upload:hover { border-color: rgba(128,104,255,.58); background: rgba(128,104,255,.065); }
.image-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.image-upload-icon { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 4px; border-radius: 13px; color: #b8acff; background: rgba(128,104,255,.12); font-size: 22px; font-weight: 300; }
.image-upload strong { font-size: 12px; }
.image-upload small { color: #697286; font-size: 9px; }
.image-upload img { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; background: #090d16; }
.image-upload.has-image::after { content: "Нажмите, чтобы заменить картинку"; position: absolute; z-index: 3; right: 10px; bottom: 10px; padding: 7px 9px; color: white; border-radius: 7px; background: rgba(7,9,16,.78); font-size: 8px; backdrop-filter: blur(6px); }
.template-name-field { margin-top: 18px; }

.confirm-modal { z-index: 190; }
.confirm-card { width: min(100%, 410px); padding: 32px; overflow: visible; text-align: center; }
.confirm-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 18px; border: 1px solid rgba(255,111,125,.24); border-radius: 17px; color: #ff8a95; background: linear-gradient(145deg, rgba(255,111,125,.13), rgba(255,111,125,.045)); box-shadow: 0 14px 35px rgba(255,80,100,.08); font-size: 22px; font-weight: 800; }
.confirm-card h3 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.confirm-card > p { margin: 11px auto 25px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
.confirm-delete-button { min-height: 43px; padding: 0 15px; color: white; border: 1px solid rgba(255,111,125,.28); border-radius: 10px; background: linear-gradient(135deg, #db5262, #f16876); box-shadow: 0 12px 28px rgba(219,82,98,.18); font-size: 10px; font-weight: 800; cursor: pointer; }
.confirm-delete-button:hover { filter: brightness(1.07); }

.settings-subnav { display: inline-flex; gap: 4px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: rgba(13,17,28,.78); }
.settings-subnav button { min-height: 37px; padding: 0 14px; color: #727c8f; border: 0; border-radius: 8px; background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; transition: .18s; }
.settings-subnav button.active { color: #d8d2ff; background: rgba(128,104,255,.13); box-shadow: inset 0 0 0 1px rgba(128,104,255,.12); }
.personal-settings-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.personal-settings-card { padding: 25px; }
.personal-card-head { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.personal-card-head .eyebrow { margin-bottom: 4px; font-size: 8px; }
.personal-card-head h3 { margin: 0; font-size: 17px; }
.personal-card-head p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.personal-profile-avatar, .personal-card-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(128,104,255,.22); border-radius: 14px; color: #c5b9ff; background: rgba(128,104,255,.1); font-size: 16px; font-weight: 800; }
.personal-card-icon { color: #a99cff; font-size: 10px; }
.personal-card-icon.bot-icon { font-size: 22px; font-weight: 500; }
.account-details { display: grid; gap: 0; margin-top: 9px; }
.account-details > div { display: flex; min-height: 49px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.account-details > div:last-child { border-bottom: 0; }
.account-details span { color: #697286; font-size: 10px; }
.account-details strong { color: #cbd1dc; font-size: 11px; }
.profile-avatar-button { position: relative; width: 72px; height: 72px; flex: 0 0 auto; overflow: hidden; padding: 0; border: 2px solid rgba(128,104,255,.28); border-radius: 50%; background: #101624; cursor: pointer; box-shadow: 0 0 0 5px rgba(128,104,255,.035); }
.profile-avatar-button > span { display: grid; width: 100%; height: 100%; place-items: center; color: #c5b9ff; font-size: 21px; font-weight: 800; }
.profile-avatar-button img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-button > b { position: absolute; right: 0; bottom: 0; left: 0; padding: 5px 2px 7px; color: white; background: rgba(6,9,15,.76); font-size: 7px; font-weight: 700; opacity: 0; transition: .18s; }
.profile-avatar-button:hover > b { opacity: 1; }
.profile-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 20px; }
.profile-fields-grid .field:nth-child(3) { grid-column: 1 / -1; }
.profile-message { margin: 12px 0 0; }
.profile-save-button { width: auto; margin: 3px 0 0 auto; }
.own-password-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 19px; }
.own-password-form .form-message { grid-column: 1 / -1; margin: 0; }
.password-save-button { grid-column: 1 / -1; justify-self: end; }
.bots-settings-card { min-height: 360px; }
.bots-list-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.bots-list-head .personal-card-head { flex: 1; padding-bottom: 0; border-bottom: 0; }
.personal-bots-list { display: grid; gap: 10px; margin-top: 18px; }
.personal-bot-card { display: flex; align-items: center; gap: 17px; min-height: 104px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(115deg, rgba(255,255,255,.025), rgba(255,255,255,.01)); }
.personal-bot-avatar { display: grid; width: 58px; height: 58px; flex: 0 0 auto; overflow: hidden; place-items: center; border: 2px solid rgba(128,104,255,.22); border-radius: 50%; color: #c4b9ff; background: rgba(128,104,255,.09); box-shadow: 0 0 0 5px rgba(128,104,255,.025); font-size: 16px; font-weight: 800; }
.personal-bot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.personal-bot-info { min-width: 0; flex: 1; }
.personal-bot-info h4 { margin: 0 0 11px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.bot-details { display: flex; flex-wrap: wrap; gap: 8px; }
.bot-detail-item { display: flex; min-width: 205px; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.055); border-radius: 9px; background: rgba(7,10,17,.38); }
.bot-detail-icon { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #aa9dff; background: rgba(128,104,255,.1); font-size: 9px; }
.bot-detail-icon.card-icon { position: relative; }
.bot-detail-icon.card-icon::before { content: ""; width: 14px; height: 9px; border: 1.3px solid currentColor; border-radius: 2px; }
.bot-detail-icon.card-icon::after { content: ""; position: absolute; width: 12px; height: 1px; top: 11px; background: currentColor; opacity: .7; }
.bot-detail-item > div { display: grid; min-width: 0; gap: 3px; }
.bot-detail-item small { color: #5f687a; font-size: 7px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.bot-detail-item strong { overflow: hidden; color: #bfc6d3; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.bot-delete-button { min-height: 38px; padding: 0 13px; color: #e77b86; border: 1px solid rgba(255,111,125,.16); border-radius: 9px; background: rgba(255,111,125,.045); font-size: 9px; font-weight: 700; cursor: pointer; }
.bot-delete-button:disabled { opacity: .5; cursor: wait; }
.bots-empty-state { display: grid; min-height: 220px; place-items: center; align-content: center; padding: 25px; text-align: center; }
.bots-empty-state > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: #a99cff; background: rgba(128,104,255,.08); font-size: 22px; }
.bots-empty-state h4 { margin: 14px 0 6px; font-size: 14px; }
.bots-empty-state p { margin: 0; color: var(--muted); font-size: 10px; }

#avatarCropModal { z-index: 180; }
.avatar-crop-card { width: min(100%, 440px); }
.crop-help { margin: -8px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.avatar-crop-stage { position: relative; width: min(300px, calc(100vw - 84px)); aspect-ratio: 1; overflow: hidden; margin: 0 auto; border-radius: 14px; background: #070a10; cursor: grab; touch-action: none; user-select: none; }
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage > img { position: absolute; max-width: none; pointer-events: none; user-select: none; }
.avatar-crop-mask { position: absolute; z-index: 2; inset: 0; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; box-shadow: 0 0 0 100px rgba(3,5,10,.68); pointer-events: none; }
.avatar-crop-mask::before, .avatar-crop-mask::after { content: ""; position: absolute; background: rgba(255,255,255,.27); }
.avatar-crop-mask::before { top: 50%; right: 0; left: 0; height: 1px; }
.avatar-crop-mask::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.zoom-control { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; margin-top: 20px; color: #8b95a7; font-size: 10px; font-weight: 700; }
.zoom-control input { width: 100%; accent-color: var(--violet); }
.crop-actions { margin-top: 18px; }

.bot-modal-card { width: min(100%, 500px); }
.bot-avatar-field { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.015); }
.bot-avatar-field > label { display: block; width: 62px; height: 62px; flex: 0 0 auto; cursor: pointer; }
.bot-avatar-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bot-avatar-field label > span { display: grid; width: 100%; height: 100%; overflow: hidden; place-items: center; border: 1px dashed rgba(128,104,255,.35); border-radius: 50%; color: #a99cff; background: rgba(128,104,255,.07); font-size: 20px; }
.bot-avatar-field img { width: 100%; height: 100%; object-fit: cover; }
.bot-avatar-field > div { display: grid; gap: 5px; }
.bot-avatar-field strong { font-size: 11px; }
.bot-avatar-field small { color: #687184; font-size: 9px; }
.bot-form-grid { margin-top: 0; }
.settings-loading { min-height: 280px; }

.install-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.install-card { width: min(100%, 520px); padding: 42px; border: 1px solid var(--line); border-radius: 22px; background: rgba(13,17,28,.88); box-shadow: var(--shadow); text-align: center; }
.install-card .brand-mark { margin: 0 auto 26px; }
.install-card h1 { margin: 0; font-size: 31px; letter-spacing: -.04em; }
.install-message { margin: 14px auto 24px; color: var(--muted); line-height: 1.6; }
.credential-box { display: grid; gap: 6px; margin: 0 0 18px; padding: 16px; border: 1px solid rgba(128,104,255,.19); border-radius: 13px; background: rgba(128,104,255,.07); }
.credential-box span { color: var(--muted); font-size: 11px; }
.credential-box strong { color: #cbc2ff; font-size: 18px; }
.install-changes { display: grid; gap: 8px; margin: 0 0 18px; padding: 14px; border: 1px solid rgba(61,220,151,.16); border-radius: 13px; background: rgba(61,220,151,.05); text-align: left; }
.install-changes span { position: relative; padding-left: 17px; color: #aeb9c8; font-size: 11px; line-height: 1.45; }
.install-changes span::before { content: "✓"; position: absolute; left: 0; color: var(--green); }
.button-link { text-decoration: none; }
.security-note { margin: 18px 0 0; color: #5d6678; font-size: 11px; line-height: 1.55; }
.security-note code { color: #8e98aa; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

@media (max-width: 980px) {
    .auth-layout { grid-template-columns: minmax(0, .85fr) minmax(400px, 1fr); }
    .auth-showcase { padding: 38px; }
    .showcase-copy h1 { font-size: 54px; }
    .metric-orb { display: none; }
    .mini-chart { width: 100%; }
    .app-shell { grid-template-columns: 220px 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card:last-child { grid-column: span 2; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .template-setting-card { grid-template-columns: 190px minmax(0, 1fr); }
    .personal-settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .auth-layout { display: block; }
    .auth-showcase { display: none; }
    .auth-panel { position: relative; min-height: 100svh; padding: 32px 22px; }
    .auth-panel::before { content: ""; position: absolute; width: 280px; height: 280px; top: -150px; right: -110px; border-radius: 50%; background: rgba(128,104,255,.22); filter: blur(90px); }
    .mobile-brand { position: absolute; top: 26px; left: 24px; display: flex; }
    .auth-box { margin-top: 65px; }
    .auth-heading { margin-bottom: 34px; }
    .auth-heading h2 { font-size: 32px; }
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; width: min(82vw, 280px); transform: translateX(-102%); transition: transform .24s ease; box-shadow: 25px 0 65px rgba(0,0,0,.35); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; display: block; background: rgba(0,0,0,.56); opacity: 0; pointer-events: none; transition: opacity .24s; }
    .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
    .topbar { height: 78px; padding: 0 18px; }
    .menu-button { display: block; margin-right: 14px; }
    .topbar > div:nth-child(2) { margin-right: auto; }
    .topbar .eyebrow { display: none; }
    .topbar h2 { font-size: 17px; }
    .profile-copy { display: none; }
    .content { padding: 28px 18px 40px; }
    .welcome-row { align-items: flex-start; flex-direction: column; margin-bottom: 25px; }
    .welcome-row h1 { font-size: 32px; }
    .live-badge { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card, .stat-card:last-child { grid-column: auto; min-height: 132px; padding: 20px; }
    .stat-card strong { font-size: 28px; }
    .activity-card, .quick-card { padding: 21px; }
    .activity-visual { align-items: flex-start; gap: 18px; }
    .pulse-ring { width: 64px; height: 64px; }
    .pulse-ring span { width: 43px; height: 43px; }
    .toast { right: 14px; bottom: 14px; left: 14px; text-align: center; }
    .install-card { padding: 30px 22px; }
    .modal { padding: 10px; }
    .modal-card { max-height: calc(100svh - 20px); padding: 22px 18px; border-radius: 17px; }
    .form-grid { grid-template-columns: 1fr; }
    .full-field { grid-column: auto; }
    .modal-actions { align-items: stretch; flex-direction: column-reverse; }
    .modal-actions-right { width: 100%; margin-left: 0; }
    .modal-actions-right > button { flex: 1; }
    .danger-button { width: 100%; }
    .user-list-actions { width: 100%; justify-content: space-between; }
    .settings-head-actions { width: 100%; justify-content: space-between; }
    .templates-grid { grid-template-columns: 1fr; }
    .template-preview { height: 165px; }
    .stream-template-card .template-image-preview { height: 300px; }
    .template-setting-card { grid-template-columns: 1fr; }
    .setting-preview { min-height: 155px; border-right: 0; border-bottom: 1px solid var(--line); }
    .setting-preview .template-preview { min-height: 155px; }
    .creator-only-badge { display: none; }
    .setting-actions { align-items: stretch; }
    .setting-state { width: 100%; }
    .template-action-button, .save-template-button { flex: 1 1 calc(50% - 8px); }
    .settings-subnav { display: grid; width: 100%; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
    .settings-subnav button { padding-inline: 8px; }
    .personal-settings-card { padding: 20px; }
    .own-password-form { grid-template-columns: 1fr; }
    .own-password-form .form-message, .password-save-button { grid-column: auto; }
    .password-save-button { width: 100%; justify-self: stretch; }
    .profile-fields-grid { grid-template-columns: 1fr; }
    .profile-fields-grid .field:nth-child(3) { grid-column: auto; }
    .profile-save-button { width: 100%; }
    .bots-list-head { align-items: stretch; flex-direction: column; }
    .bots-list-head .add-user-button { justify-content: center; }
    .personal-bot-card { align-items: flex-start; flex-wrap: wrap; }
    .bot-delete-button { width: 100%; }
}

@media (max-width: 390px) {
    .auth-panel { padding-inline: 18px; }
    .input-wrap input { height: 54px; }
    .primary-button { min-height: 54px; }
    .content { padding-inline: 14px; }
    .card-heading { align-items: flex-start; flex-direction: column; }
}

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