:root {
  --bg: #080b0a;
  --panel: #0f1311;
  --panel-2: #151a17;
  --line: #28302b;
  --line-light: #343d37;
  --text: #f4f7f5;
  --muted: #8f9a94;
  --accent: #b7f34a;
  --accent-dark: #7bad24;
  --danger: #ff6b6b;
  --success: #6fe39b;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.auth-body { overflow-x: hidden; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(420px, .95fr); }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 7vw, 110px); overflow: hidden; border-right: 1px solid var(--line); }
.auth-brand::before { content: ""; position: absolute; width: 560px; height: 560px; left: -180px; top: -210px; border: 1px solid rgba(183, 243, 74, .15); border-radius: 50%; box-shadow: 0 0 0 70px rgba(183, 243, 74, .025), 0 0 0 140px rgba(183, 243, 74, .018); }
.auth-brand::after { content: ""; position: absolute; width: 240px; height: 1px; right: 0; bottom: 14%; background: linear-gradient(90deg, transparent, var(--accent)); opacity: .55; }
.brand-mark { position: relative; display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 58px; color: var(--accent); border: 1px solid var(--line-light); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.brand-mark svg { width: 42px; height: 42px; }
.eyebrow, .section-label, .topbar-kicker { margin: 0; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.auth-brand h1 { position: relative; max-width: 720px; margin: 16px 0 10px; font-size: clamp(48px, 6.5vw, 104px); line-height: .9; letter-spacing: -.07em; }
.brand-copy { margin: 0; color: var(--muted); font-size: clamp(18px, 2vw, 28px); letter-spacing: .16em; }
.auth-points { display: grid; gap: 2px; max-width: 620px; margin-top: 74px; }
.auth-points div { display: grid; grid-template-columns: 48px 1fr; align-items: center; min-height: 54px; border-top: 1px solid var(--line); }
.auth-points span { color: var(--accent); font: 700 11px ui-monospace, monospace; }
.auth-points p { margin: 0; color: #cbd2ce; font-size: 14px; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; background: radial-gradient(circle at 90% 5%, rgba(183, 243, 74, .07), transparent 28%), var(--panel); }
.auth-card { width: min(100%, 470px); padding: clamp(30px, 5vw, 52px); border: 1px solid var(--line); border-radius: 26px; background: rgba(8, 11, 10, .88); box-shadow: var(--shadow); }
.auth-card-head { margin-bottom: 32px; }
.auth-card-head h2 { margin: 12px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.auth-card-head p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.auth-foot { margin: 24px 0 0; color: #637068; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.auth-switch { margin: 26px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.auth-switch a { color: var(--text); font-weight: 700; text-underline-offset: 4px; }

.form-stack { display: grid; gap: 19px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; }
.field-wide { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 8px; }
label > span, legend { color: #cbd2ce; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
label small { color: #6f7b74; font-size: 11px; }
input, select { width: 100%; min-height: 49px; padding: 0 15px; color: var(--text); border: 1px solid var(--line-light); border-radius: 11px; outline: none; background: #0b0f0d; transition: border-color .18s, box-shadow .18s, background .18s; }
input::placeholder { color: #566159; }
input:focus, select:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(183, 243, 74, .09); background: #0d120f; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px; }
.password-toggle { position: absolute; top: 4px; right: 4px; width: 41px; height: 41px; padding: 0; display: grid; place-items: center; color: var(--muted); border: 0; background: transparent; cursor: pointer; }
.password-toggle svg { width: 19px; }
.button { min-height: 48px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .16s, background .16s, border-color .16s, opacity .16s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button svg { width: 18px; height: 18px; }
.button-primary { color: #10140e; background: var(--accent); }
.button-primary:hover { background: #c5ff55; }
.button-secondary { border-color: var(--line-light); background: transparent; }
.button-danger { color: #190b0b; background: var(--danger); }
.button-full { width: 100%; margin-top: 4px; }
.button.is-loading span { opacity: .6; }
.button.is-loading svg { animation: pulse .8s infinite alternate; }
.alert { margin-bottom: 20px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.alert-error { color: #ffaaaa; border-color: rgba(255, 107, 107, .3); background: rgba(255, 107, 107, .08); }
.alert-success { color: #9ff1bc; border-color: rgba(111, 227, 155, .3); background: rgba(111, 227, 155, .08); }

.dashboard-body { background: #0a0d0b; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 30; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; border-right: 1px solid var(--line); background: #090c0a; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 8px 9px 28px; border-bottom: 1px solid var(--line); }
.mini-mark { width: 42px; height: 42px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--line-light); border-radius: 12px; background: var(--panel); }
.mini-mark svg { width: 27px; height: 27px; }
.sidebar-brand div:last-child { display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 13px; letter-spacing: .08em; }
.sidebar-brand span, .sidebar-account span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.side-nav { display: grid; gap: 5px; margin-top: 24px; }
.nav-button { width: 100%; min-height: 48px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 11px; padding: 0 13px; color: var(--muted); border: 1px solid transparent; border-radius: 11px; background: transparent; cursor: pointer; text-align: left; font-size: 13px; }
.nav-button svg { width: 19px; height: 19px; }
.nav-button:hover { color: var(--text); background: var(--panel); }
.nav-button.is-active { color: #10140e; background: var(--accent); }
.nav-count { min-width: 22px; padding: 3px 6px; color: inherit; border: 1px solid currentColor; border-radius: 99px; font: 700 10px ui-monospace, monospace; text-align: center; opacity: .7; }
.sidebar-account { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 10px; margin-top: auto; padding: 15px 8px 2px; border-top: 1px solid var(--line); }
.sidebar-account div:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.sidebar-account strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.avatar-text { width: 36px; height: 36px; display: grid; place-items: center; color: #11160d; border-radius: 10px; background: var(--accent); font-size: 13px; font-weight: 900; }
.icon-button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; color: var(--muted); border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--text); background: var(--panel-2); }
.icon-button svg { width: 19px; height: 19px; }
.icon-button.bordered { border: 1px solid var(--line); }

.main-area { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 82px; display: flex; align-items: center; gap: 16px; padding: 0 clamp(22px, 4vw, 52px); border-bottom: 1px solid rgba(40, 48, 43, .82); background: rgba(10, 13, 11, .88); backdrop-filter: blur(18px); }
.topbar h1 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.03em; }
.connection-state { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font: 700 10px ui-monospace, monospace; letter-spacing: .08em; }
.connection-state span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(183, 243, 74, .08); }
.mobile-menu { display: none; }
.content-panel { display: none; padding: clamp(24px, 4vw, 52px); }
.content-panel.is-active { display: block; animation: reveal .24s ease-out; }
.welcome-card { min-height: 250px; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; padding: clamp(28px, 5vw, 58px); border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle at 88% 20%, rgba(183, 243, 74, .13), transparent 30%), linear-gradient(135deg, #121713, #0d110f); overflow: hidden; }
.welcome-card h2 { max-width: 690px; margin: 13px 0 15px; font-size: clamp(34px, 5vw, 66px); line-height: .98; letter-spacing: -.06em; }
.welcome-card p:last-child { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.7; }
.signal-visual { display: flex; align-items: flex-end; gap: 7px; height: 110px; padding-right: 10px; }
.signal-visual span { width: 13px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 22px rgba(183, 243, 74, .18); }
.signal-visual span:nth-child(1) { height: 24%; opacity: .35; }.signal-visual span:nth-child(2) { height: 43%; opacity: .5; }.signal-visual span:nth-child(3) { height: 64%; opacity: .68; }.signal-visual span:nth-child(4) { height: 82%; opacity: .84; }.signal-visual span:nth-child(5) { height: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.stat-card { position: relative; min-height: 142px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.stat-card strong { display: block; margin-top: 24px; font: 800 31px ui-monospace, monospace; }
.stat-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.stat-index { position: absolute; top: 15px; right: 16px; color: #59645d; font: 700 10px ui-monospace, monospace; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.quick-card { min-height: 92px; display: grid; grid-template-columns: 40px 1fr 24px; align-items: center; gap: 13px; padding: 18px; color: var(--text); border: 1px solid var(--line); border-radius: 15px; background: transparent; cursor: pointer; text-align: left; }
.quick-card:hover { border-color: var(--line-light); background: var(--panel); }
.quick-card > svg:first-child { color: var(--accent); }
.quick-card > svg:last-child { color: var(--muted); }
.quick-card span { display: grid; gap: 5px; }
.quick-card strong { font-size: 13px; }.quick-card small { color: var(--muted); font-size: 11px; line-height: 1.4; }

.page-grid { display: grid; gap: 14px; }.two-column { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
.workspace-card { padding: clamp(23px, 3vw, 34px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 30px; }
.card-head h2 { margin: 9px 0 0; font-size: 25px; letter-spacing: -.04em; }
.card-head p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.step-badge { flex: 0 0 auto; padding: 6px 9px; color: var(--accent); border: 1px solid rgba(183, 243, 74, .25); border-radius: 99px; background: rgba(183, 243, 74, .05); font: 700 9px ui-monospace, monospace; letter-spacing: .08em; }
.result-card { min-height: 390px; }
.empty-result { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 18px; color: var(--muted); border: 1px solid var(--line); border-radius: 16px; background: #0b0f0d; }
.empty-result h3 { margin: 0 0 7px; font-size: 17px; }.empty-result p { margin: 0; color: var(--muted); font-size: 12px; }
.channel-profile { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 17px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.channel-photo { width: 76px; height: 76px; display: grid; place-items: center; overflow: hidden; color: var(--accent); border: 1px solid var(--line-light); border-radius: 21px; background: #0a0e0c; font-size: 25px; font-weight: 900; }
.channel-photo img { width: 100%; height: 100%; object-fit: cover; }.channel-profile h3 { margin: 0; font-size: 21px; }.channel-profile p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.verified-badge { padding: 6px 9px; color: var(--accent); border: 1px solid rgba(183, 243, 74, .24); border-radius: 99px; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.detail-list { display: grid; gap: 0; margin-top: 18px; }.detail-row { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; }.detail-row span { color: var(--muted); }.detail-row strong { overflow-wrap: anywhere; font-weight: 600; }
.form-card-wide { max-width: 850px; }.inline-result { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; color: #d8dfdb; background: #0b0f0d; font: 12px ui-monospace, monospace; line-height: 1.7; }
.mode-fieldset { margin: 0; padding: 0; border: 0; }.mode-fieldset legend { margin-bottom: 9px; }.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.radio-card { position: relative; min-height: 73px; display: flex; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }.radio-card:has(input:checked) { border-color: var(--accent-dark); background: rgba(183, 243, 74, .05); }.radio-card input { position: absolute; opacity: 0; pointer-events: none; }.radio-card span { display: grid; gap: 4px; }.radio-card strong { font-size: 12px; }.radio-card small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.auto-layout { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(440px, 1.2fr); gap: 14px; }.auto-list-card { min-width: 0; }.auto-list { display: grid; gap: 9px; }.list-loading, .list-empty { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 13px; color: var(--muted); font-size: 12px; }.list-loading span { width: 26px; height: 26px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }.auto-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #0b0f0d; }.auto-item h3 { overflow: hidden; margin: 0 0 5px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.auto-item p { margin: 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }.auto-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }.auto-meta span { padding: 5px 7px; color: #aeb8b2; border: 1px solid var(--line); border-radius: 6px; font: 700 9px ui-monospace, monospace; text-transform: uppercase; }.delete-auto { align-self: center; color: #b87575; }.delete-auto:hover { color: var(--danger); background: rgba(255, 107, 107, .08); }
.toast { position: fixed; z-index: 80; top: 98px; right: 24px; max-width: min(390px, calc(100vw - 48px)); padding: 13px 16px; border: 1px solid var(--line-light); border-radius: 11px; background: #151a17; box-shadow: var(--shadow); font-size: 12px; line-height: 1.5; animation: toast-in .2s ease-out; }.toast.success { color: #b5efca; border-color: rgba(111, 227, 155, .28); }.toast.error { color: #ffb2b2; border-color: rgba(255, 107, 107, .28); }
.dialog-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .72); backdrop-filter: blur(8px); }.dialog { width: min(100%, 410px); padding: 30px; border: 1px solid var(--line-light); border-radius: 19px; background: var(--panel); box-shadow: var(--shadow); text-align: center; }.dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 18px; color: var(--danger); border: 1px solid rgba(255, 107, 107, .2); border-radius: 15px; background: rgba(255, 107, 107, .06); }.dialog h2 { margin: 0; font-size: 21px; }.dialog p { margin: 10px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.6; }.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }.sidebar-backdrop { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { transform: translateX(3px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: 1fr 1fr; }.auth-brand { padding: 48px; }.auth-brand h1 { font-size: 58px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }.quick-grid { grid-template-columns: 1fr; }.auto-layout { grid-template-columns: 1fr; }.two-column { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .auth-shell { display: block; }.auth-brand { min-height: 330px; padding: 38px 25px; border-right: 0; border-bottom: 1px solid var(--line); }.brand-mark { width: 54px; height: 54px; margin-bottom: 35px; border-radius: 15px; }.brand-mark svg { width: 32px; }.auth-brand h1 { font-size: clamp(43px, 13vw, 68px); }.brand-copy { font-size: 14px; }.auth-points { display: none; }.auth-panel { padding: 28px 18px 36px; }.auth-card { padding: 28px 22px; border-radius: 20px; }.auth-card-head h2 { font-size: 27px; }
  .app-shell { display: block; }.sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(290px, 84vw); transition: transform .22s ease; box-shadow: var(--shadow); }.sidebar.is-open { transform: translateX(0); }.sidebar-backdrop { position: fixed; z-index: 25; inset: 0; background: rgba(0, 0, 0, .62); }.sidebar-backdrop.is-open { display: block; }.mobile-menu { display: grid; }.topbar { min-height: 72px; padding: 0 17px; }.topbar h1 { font-size: 18px; }.topbar-kicker { font-size: 9px; }.connection-state { font-size: 8px; }.content-panel { padding: 20px 15px 34px; }.welcome-card { min-height: 340px; display: block; padding: 28px 23px; }.welcome-card h2 { font-size: 42px; }.signal-visual { height: 58px; margin-top: 35px; }.signal-visual span { width: 9px; }.stat-grid { gap: 8px; }.stat-card { min-height: 126px; padding: 17px; }.quick-grid { margin-top: 20px; }.form-grid, .form-row { grid-template-columns: 1fr; }.field-wide { grid-column: auto; }.auto-layout { grid-template-columns: minmax(0, 1fr); }.auto-item { grid-template-columns: minmax(0, 1fr) 38px; }.card-head { margin-bottom: 24px; }.workspace-card { padding: 21px 17px; }.mode-options { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }.stat-card strong { font-size: 25px; }.connection-state { display: none; }.channel-profile { grid-template-columns: 62px 1fr; }.channel-photo { width: 62px; height: 62px; border-radius: 17px; }.verified-badge { grid-column: 1 / -1; width: max-content; }.detail-row { grid-template-columns: 90px 1fr; }
}

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