:root {
    color-scheme: dark;
    --page: #070a11;
    --page-soft: #0a0e18;
    --panel: #101625;
    --panel-strong: #0b1020;
    --panel-hover: #151d30;
    --line: #202a3d;
    --line-soft: #182135;
    --text: #f7f8fc;
    --muted: #98a4ba;
    --muted-strong: #b8c1d2;
    --accent: #7757ff;
    --accent-hover: #896fff;
    --accent-soft: rgba(119, 87, 255, .16);
    --green: #43df91;
    --green-soft: rgba(38, 189, 113, .17);
    --yellow: #f0b95d;
    --red: #ff7474;
    --shadow: 0 26px 70px rgba(0, 0, 0, .26);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--page); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
a { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(137, 111, 255, .42); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.wordmark { display: inline-flex; align-items: center; gap: 7px; color: #fff; font-size: 23px; font-weight: 850; letter-spacing: -.9px; text-decoration: none; }
.wordmark-mark { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: linear-gradient(145deg, #866cff, #6040eb); box-shadow: 0 10px 26px rgba(119,87,255,.28); font-size: 15px; letter-spacing: -.5px; }
.wordmark-small { font-size: 20px; }
.wordmark-small .wordmark-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.button { display: inline-flex; min-height: 44px; padding: 10px 18px; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; color: #fff; font-weight: 760; text-decoration: none; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); box-shadow: 0 10px 30px rgba(119,87,255,.18); }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary, .button-ghost { border-color: var(--line); background: transparent; color: var(--text); }
.button-secondary:hover, .button-ghost:hover { border-color: #36425b; background: rgba(255,255,255,.035); }
.button-large { min-height: 52px; padding: 13px 23px; border-radius: 14px; }
.button-wide { width: 100%; }
.button-count { display: grid; min-width: 22px; height: 22px; padding: 0 6px; place-items: center; border-radius: 999px; background: var(--accent); font-size: 12px; }

/* Public landing */
.landing-page { background: radial-gradient(circle at 72% 20%, rgba(95,61,226,.1), transparent 28%), var(--page); }
.landing-container { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.landing-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(32,42,61,.85); background: rgba(7,10,17,.84); backdrop-filter: blur(16px); }
.landing-nav { display: grid; min-height: 80px; grid-template-columns: 1fr auto 1fr; align-items: center; }
.landing-links { display: flex; gap: 34px; }
.landing-links a { color: var(--muted-strong); font-size: 14px; font-weight: 650; text-decoration: none; }
.landing-links a:hover { color: #fff; }
.landing-login { justify-self: end; min-width: 132px; }
.hero { min-height: calc(100vh - 80px); padding: 92px 0 84px; display: grid; align-items: center; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.07fr) minmax(400px, .72fr); align-items: center; gap: 80px; }
.hero-kicker, .section-label { display: inline-flex; align-items: center; gap: 9px; color: #b3a6ff; font-size: 13px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(67,223,145,.09), 0 0 18px var(--green); }
.hero h1 { max-width: 790px; margin: 28px 0 28px; font-size: clamp(55px, 6.4vw, 92px); line-height: .94; letter-spacing: -.065em; }
.hero-copy > p { max-width: 700px; margin: 0; color: var(--muted-strong); font-size: clamp(18px, 1.6vw, 22px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 37px; }
.invite-note { display: flex; align-items: center; gap: 10px; margin-top: 25px; color: #7f8aa0; font-size: 13px; }
.invite-note span { color: #b3a6ff; }
.hero-console { padding: 24px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(160deg, rgba(18,25,42,.96), rgba(9,14,25,.98)); box-shadow: var(--shadow); transform: rotate(1deg); }
.console-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.console-top strong { display: block; margin-top: 3px; font-size: 19px; }
.console-eyebrow { color: var(--muted); font-size: 12px; }
.console-count { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: #c4b9ff; font-weight: 800; }
.comment-preview { margin-top: 12px; padding: 17px; border: 1px solid var(--line-soft); border-radius: 16px; background: #0b1020; }
.comment-preview-active { border-color: rgba(119,87,255,.35); }
.comment-preview-meta { display: flex; align-items: center; justify-content: space-between; color: #738097; font-size: 11px; }
.comment-preview > p { margin: 14px 0 2px; color: #dce1ec; font-size: 14px; line-height: 1.5; }
.platform-badge { padding: 5px 8px; border-radius: 7px; color: #fff; font-size: 10px; font-weight: 800; }
.badge-vk { background: #2787f5; }
.badge-youtube { background: #df2525; }
.draft-preview { margin-top: 15px; padding: 12px 13px; border-left: 2px solid var(--accent); border-radius: 0 9px 9px 0; background: rgba(119,87,255,.08); }
.draft-preview span { color: #a899ff; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.draft-preview p { margin: 6px 0 0; color: #bfc7d6; font-size: 12px; line-height: 1.5; }
.console-footer { display: flex; align-items: center; gap: 10px; padding: 18px 4px 0; color: var(--muted); font-size: 12px; }
.console-footer .live-dot { width: 7px; height: 7px; box-shadow: 0 0 12px var(--green); }
.landing-section { padding: 110px 0; border-top: 1px solid var(--line-soft); }
.section-heading { max-width: 740px; }
.section-heading > span { color: #a899ff; font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.section-heading h2, .platform-row h2 { margin: 15px 0 0; font-size: clamp(36px, 4.2vw, 58px); line-height: 1.05; letter-spacing: -.045em; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 55px; }
.feature-card { min-height: 250px; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, var(--panel), #0b101c); }
.feature-number { color: #8066ff; font-size: 13px; font-weight: 800; }
.feature-card h3 { margin: 67px 0 13px; font-size: 26px; letter-spacing: -.025em; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.62; }
.platforms-section { background: #0a0e17; }
.platform-row { display: grid; grid-template-columns: .9fr 1.1fr; align-items: end; gap: 80px; }
.platform-row h2 { max-width: 560px; font-size: clamp(34px, 3.6vw, 52px); }
.platform-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.platform-list span { padding: 16px 21px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: #d8ddea; font-weight: 750; }
.landing-footer { padding: 36px 0; border-top: 1px solid var(--line); background: #06080e; }
.landing-footer .landing-container { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.landing-footer p { color: var(--muted); font-size: 13px; }
.landing-footer > div > a:last-child { justify-self: end; color: #b3a6ff; font-size: 13px; text-decoration: none; }

/* Authentication */
.auth-page { display: grid; min-height: 100vh; padding: 34px 20px; place-items: center; background: radial-gradient(circle at 50% 0, rgba(119,87,255,.14), transparent 34%), var(--page); }
.auth-shell { width: min(460px, 100%); }
.auth-shell > .wordmark { margin: 0 0 24px; }
.auth-card { padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(155deg, #111725, #0b101c); box-shadow: var(--shadow); }
.auth-card h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.auth-lead { margin: 12px 0 25px; color: var(--muted); line-height: 1.6; }
.auth-lead strong { color: var(--text); }
.auth-field { display: block; margin-top: 18px; }
.auth-field > span { display: block; margin-bottom: 8px; color: #d7ddea; font-size: 13px; font-weight: 750; }
.auth-field input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #080d18; color: #fff; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(119,87,255,.1); }
.auth-submit { width: 100%; margin-top: 23px; }
.auth-note, .auth-hint { color: #6f7b91; font-size: 12px; line-height: 1.55; }
.auth-note { margin: 20px 0 0; text-align: center; }
.auth-hint { margin: 8px 0 0; }

/* Application */
.app-page { background: radial-gradient(circle at 50% -25%, rgba(119,87,255,.09), transparent 34%), var(--page-soft); }
.app-container { width: min(1380px, calc(100% - 52px)); margin: 0 auto; }
.app-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: rgba(8,12,21,.9); backdrop-filter: blur(18px); }
.app-header-inner { display: grid; min-height: 76px; grid-template-columns: 1fr auto 1fr; align-items: center; }
.app-nav { display: flex; align-items: center; gap: 8px; }
.app-nav a { padding: 10px 14px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.app-nav a:hover, .app-nav a.active { background: rgba(255,255,255,.045); color: #fff; }
.account-menu { display: flex; justify-self: end; align-items: center; gap: 10px; }
.account-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #222b40; color: #fff; font-size: 13px; font-weight: 800; }
.account-name { max-width: 150px; overflow: hidden; color: var(--muted-strong); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 8px 10px; border: 0; background: none; color: #7f8aa1; cursor: pointer; font-size: 13px; }
.text-button:hover { color: #fff; }
.app-content { padding: 48px 0 80px; }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.app-eyebrow { margin: 0 0 8px; color: #8e7afd; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.workspace-head h1 { margin: 0; font-size: clamp(38px, 4vw, 54px); letter-spacing: -.045em; }
.workspace-head p:not(.app-eyebrow) { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.project-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(370px, 530px); gap: 18px; margin-top: 32px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: #0c1120; }
.project-tabs { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.project-tab { display: inline-flex; min-width: max-content; min-height: 47px; padding: 9px 13px; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); font-size: 14px; font-weight: 720; text-decoration: none; }
.project-tab:hover { color: #fff; background: rgba(255,255,255,.035); }
.project-tab.active { border-color: rgba(119,87,255,.4); background: var(--accent-soft); color: #fff; }
.project-tab small { display: grid; min-width: 22px; height: 22px; padding: 0 5px; place-items: center; border-radius: 7px; background: rgba(255,255,255,.07); color: #aeb7c8; font-size: 10px; }
.add-project-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.add-project-form input, .add-source-form input, .add-source-form select { min-width: 0; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #080d18; color: #fff; }
.add-project-form input:focus, .add-source-form input:focus, .add-source-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(119,87,255,.1); }
input::placeholder { color: #5f6b82; }
.project-summary { display: flex; min-height: 165px; margin-top: 20px; padding: 29px 32px; align-items: center; justify-content: space-between; gap: 30px; border: 1px solid #252d48; border-radius: 21px; background: linear-gradient(125deg, #161a30, #11172a 60%, rgba(119,87,255,.15)); }
.project-status { display: inline-flex; align-items: center; gap: 7px; color: #7eeab2; font-size: 12px; font-weight: 750; }
.project-status i, .status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.project-summary h2 { margin: 12px 0 5px; font-size: 32px; letter-spacing: -.035em; }
.project-summary p { margin: 0; color: var(--muted); }
.project-metrics { display: grid; grid-template-columns: repeat(3, minmax(94px, 1fr)); }
.project-metrics div { min-width: 110px; padding: 5px 24px; border-left: 1px solid rgba(255,255,255,.09); }
.project-metrics strong, .project-metrics span { display: block; }
.project-metrics strong { font-size: 28px; }
.project-metrics span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .55fr); align-items: start; gap: 20px; margin-top: 20px; }
.dashboard-aside { display: grid; gap: 20px; }
.dark-panel { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 15px 45px rgba(0,0,0,.13); }
.dashboard-main > .dark-panel { padding: 27px; }
.dashboard-aside .dark-panel { padding: 24px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-title-row h2 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
.panel-counter { display: grid; min-width: 37px; height: 37px; padding: 0 9px; place-items: center; border-radius: 11px; background: rgba(255,255,255,.055); color: #b8c1d2; font-size: 13px; font-weight: 800; }
.panel-counter.accent { background: var(--accent-soft); color: #c1b6ff; }
.source-cards { display: grid; gap: 11px; margin-top: 22px; }
.source-card { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--panel-strong); transition: border-color .16s ease, transform .16s ease; }
.source-card:hover { border-color: #303a51; transform: translateY(-1px); }
.source-card-top { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 15px; padding: 18px; }
.platform-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #fff; font-size: 12px; font-weight: 850; text-transform: uppercase; }
.platform-youtube { background: #df2525; }
.platform-telegram { background: #249bd7; }
.platform-vk { background: #2787f5; }
.platform-dzen { background: linear-gradient(135deg, #fff 50%, #111 50%); color: #111; }
.platform-rutube { background: #13d8b0; color: #061813; }
.source-copy { min-width: 0; }
.source-title-line { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.source-title-line h3 { margin: 0; font-size: 16px; }
.source-copy > strong { display: block; margin-top: 7px; overflow: hidden; color: #d5dbe8; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.source-copy > a { display: block; margin-top: 5px; overflow: hidden; color: #7788ad; font-size: 12px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.source-copy > a:hover { color: #abbbdf; }
.status-pill { display: inline-flex; flex: 0 0 auto; padding: 6px 9px; align-items: center; gap: 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-success { background: var(--green-soft); color: #6be8a8; }
.status-pending { background: rgba(240,185,93,.12); color: var(--yellow); }
.status-danger { background: rgba(255,116,116,.12); color: var(--red); }
.status-muted { background: rgba(135,146,166,.11); color: #8d99ad; }
.source-card-foot { display: flex; padding: 11px 18px; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line-soft); color: #637087; font-size: 11px; }
.source-card-foot strong { color: #8d99ae; font-weight: 650; }
.source-next-step { padding: 11px 18px; border-top: 1px solid rgba(240,185,93,.12); background: rgba(240,185,93,.045); color: #baa170; font-size: 11px; line-height: 1.5; }
.empty-dark { padding: 48px 20px; text-align: center; }
.empty-dark > span { display: grid; width: 45px; height: 45px; margin: 0 auto 15px; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: #a796ff; }
.empty-dark h3 { margin: 0; }
.empty-dark p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.add-source-form { display: grid; grid-template-columns: 155px minmax(180px, 1fr) auto; gap: 9px; margin-top: 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.add-source-form select { width: 100%; cursor: pointer; }
.form-note { margin: 10px 0 0; color: #68758b; font-size: 11px; }
.source-form-error { display: grid; gap: 4px; margin-top: 10px; color: #ff9e9e; font-size: 12px; }
.queue-stat { display: flex; padding: 17px 0; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
.queue-stat strong { color: #fff; font-size: 20px; }
.queue-empty { padding: 31px 5px; text-align: center; }
.queue-empty > span { display: grid; width: 38px; height: 38px; margin: 0 auto 13px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 850; }
.queue-empty strong { display: block; font-size: 14px; }
.queue-empty p { margin: 8px auto 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.queue-preview-list { display: grid; gap: 8px; padding: 15px 0; }
.queue-preview-item { padding: 11px 12px; border-radius: 10px; background: #0b1020; }
.queue-preview-item span { color: #9c8aff; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.queue-preview-item p { margin: 6px 0 0; color: #aeb7c8; font-size: 11px; line-height: 1.45; }
.project-info-panel dl { margin: 18px 0 0; }
.project-info-panel dl div { display: flex; padding: 12px 0; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); font-size: 12px; }
.project-info-panel dt { color: var(--muted); }
.project-info-panel dd { margin: 0; color: #d2d8e4; font-weight: 700; }
.first-project { margin-top: 20px; padding: 80px 30px; text-align: center; }
.first-project > span { display: grid; width: 58px; height: 58px; margin: 0 auto 19px; place-items: center; border-radius: 17px; background: var(--accent); font-weight: 850; }
.first-project h2 { margin: 0; font-size: 28px; }
.first-project p { margin: 10px 0 0; color: var(--muted); }
.alert { margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 13px; }
.alert-success { border-color: rgba(67,223,145,.35); color: #82e9b4; }
.alert-error { border-color: rgba(255,116,116,.35); color: #ff9e9e; }
.alert ul { margin: 7px 0 0; padding-left: 19px; }

@media (max-width: 1050px) {
    .hero-grid { grid-template-columns: 1fr; gap: 55px; }
    .hero-console { width: min(620px, 100%); transform: none; }
    .project-bar { grid-template-columns: 1fr; }
    .dashboard-columns { grid-template-columns: 1fr; }
    .dashboard-aside { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
    .landing-container, .app-container { width: min(100% - 28px, 1200px); }
    .landing-nav { min-height: 68px; grid-template-columns: 1fr auto; }
    .landing-links { display: none; }
    .hero { min-height: auto; padding: 68px 0; }
    .hero h1 { font-size: clamp(48px, 14vw, 72px); }
    .steps-grid, .platform-row { grid-template-columns: 1fr; }
    .platform-row { gap: 36px; }
    .platform-list { justify-content: flex-start; }
    .landing-footer .landing-container { grid-template-columns: 1fr auto; }
    .landing-footer p { display: none; }
    .app-header-inner { min-height: 68px; grid-template-columns: auto 1fr; }
    .app-nav { position: fixed; right: 14px; bottom: 14px; left: 14px; z-index: 50; display: grid; grid-template-columns: repeat(3,1fr); padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: rgba(10,15,27,.96); box-shadow: 0 15px 40px rgba(0,0,0,.4); backdrop-filter: blur(14px); }
    .app-nav a { padding: 10px 5px; text-align: center; }
    .account-menu { justify-self: end; }
    .account-name { display: none; }
    .app-content { padding-top: 34px; padding-bottom: 105px; }
    .workspace-head { align-items: flex-start; flex-direction: column; }
    .workspace-head .button { width: 100%; }
    .add-project-form { grid-template-columns: 1fr; }
    .project-summary { align-items: flex-start; flex-direction: column; }
    .project-metrics { width: 100%; }
    .project-metrics div { min-width: 0; padding: 5px 14px; }
    .add-source-form { grid-template-columns: 1fr; }
    .dashboard-aside { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .landing-login { min-width: auto; padding: 9px 13px; }
    .hero { padding-top: 54px; }
    .hero h1 { margin-top: 22px; font-size: clamp(43px, 13.5vw, 62px); }
    .hero-copy > p { font-size: 17px; }
    .hero-actions .button { width: 100%; }
    .hero-console { padding: 15px; border-radius: 19px; }
    .landing-section { padding: 75px 0; }
    .steps-grid { margin-top: 35px; }
    .feature-card { min-height: 220px; }
    .platform-list span { padding: 12px 15px; }
    .text-button { padding-right: 0; }
    .workspace-head h1 { font-size: 39px; }
    .project-bar { padding: 9px; }
    .project-summary { padding: 24px 20px; }
    .project-summary h2 { font-size: 27px; }
    .project-metrics strong { font-size: 23px; }
    .project-metrics span { font-size: 9px; }
    .dashboard-main > .dark-panel { padding: 18px; }
    .source-title-line { align-items: flex-start; flex-direction: column; gap: 8px; }
    .source-card-foot { align-items: flex-start; flex-direction: column; gap: 5px; }
    .auth-page { padding: 20px 14px; }
    .auth-card { padding: 26px 20px; }
    .auth-card h1 { font-size: 30px; }
}
