/* Digital World Ecosystem — неоновий дизайн */
:root {
  --bg: #06041a;
  --bg2: #0d0930;
  --panel: rgba(22, 17, 60, .62);
  --panel-solid: #140f38;
  --panel2: rgba(255, 255, 255, .04);
  --border: rgba(150, 130, 255, .18);
  --border-strong: rgba(150, 130, 255, .38);
  --text: #eeeaff;
  --muted: #9d98c9;
  --cyan: #00f0ff;
  --pink: #ff2bd6;
  --violet: #8b5cff;
  --yellow: #ffe14d;
  --blue: #2b8cff;
  --green: #22ff88;
  --orange: #ff9d2b;
  --red: #ff4d6d;
  --grad: linear-gradient(135deg, #00f0ff 0%, #8b5cff 50%, #ff2bd6 100%);
  --grad-ua: linear-gradient(135deg, #2b8cff, #ffe14d);
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --glow: 0 0 24px rgba(139, 92, 255, .45);
  --font: 'Manrope', system-ui, sans-serif;
  --font-display: 'Unbounded', 'Manrope', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; overflow-x: hidden; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }
::selection { background: var(--pink); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 255, .35); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- фон ---------- */
#bg-canvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-blobs { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at top, #150c45 0%, var(--bg) 60%); }
.bg-blobs i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; animation: float 22s ease-in-out infinite alternate; }
.bg-blobs i:nth-child(1) { width: 520px; height: 520px; background: var(--violet); top: -120px; left: -80px; }
.bg-blobs i:nth-child(2) { width: 460px; height: 460px; background: var(--pink); bottom: -160px; right: -100px; animation-delay: -6s; }
.bg-blobs i:nth-child(3) { width: 380px; height: 380px; background: var(--cyan); top: 40%; left: 45%; opacity: .18; animation-delay: -12s; }
@keyframes float { to { transform: translate(80px, 60px) scale(1.15); } }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px; background: rgba(10, 7, 34, .78); backdrop-filter: blur(18px); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #2d1468; box-shadow: 0 0 18px rgba(255, 225, 77, .35); font-size: 22px; overflow: hidden; }
.brand b { font-family: var(--font-display); font-size: 15px; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.nav-section { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; padding: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--text); font-weight: 600; font-size: 14px; position: relative; transition: background .2s, transform .2s; }
.nav-link:hover { background: var(--panel2); text-decoration: none; transform: translateX(3px); }
.nav-link.active { background: linear-gradient(90deg, rgba(139, 92, 255, .35), rgba(0, 240, 255, .08)); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-link.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--grad); box-shadow: 0 0 12px var(--cyan); }
.nav-link .ico { width: 22px; text-align: center; font-size: 17px; }
.nav-link .count { margin-left: auto; background: var(--pink); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(6, 4, 26, .6); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar .title { font-family: var(--font-display); font-size: 16px; }
.topbar .spacer { flex: 1; }
.burger { display: none; }
.view { padding: 28px; max-width: 1500px; width: 100%; margin: 0 auto; }
.view > * { animation: fadeUp .5s both; }
.view > *:nth-child(2) { animation-delay: .05s; } .view > *:nth-child(3) { animation-delay: .1s; } .view > *:nth-child(4) { animation-delay: .15s; } .view > *:nth-child(5) { animation-delay: .2s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- елементи ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(14px); box-shadow: var(--shadow); position: relative; }
.card.hover { transition: transform .25s, box-shadow .25s, border-color .25s; cursor: pointer; }
.card.hover:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow), var(--glow); }
.card-neon { position: relative; }
.card-neon::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7; pointer-events: none; animation: hue 8s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.auto-s { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { margin-left: auto; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.btn { --c: var(--violet); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .05); color: var(--text); font: 700 14px var(--font); cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap; text-decoration: none !important; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 18px rgba(139, 92, 255, .4); background: rgba(255, 255, 255, .09); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad); background-size: 200% 200%; border: 0; color: #fff; box-shadow: 0 0 22px rgba(255, 43, 214, .35); animation: gradmove 6s ease infinite; }
.btn-primary:hover { box-shadow: 0 0 32px rgba(0, 240, 255, .55); background: var(--grad); background-size: 200% 200%; }
@keyframes gradmove { 50% { background-position: 100% 50%; } }
.btn-ua { background: var(--grad-ua); color: #10093a; border: 0; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { border-color: rgba(255, 77, 109, .5); color: #ff9fb1; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 10px; }
.btn-icon { padding: 7px 9px; }
.btn:disabled { opacity: .5; pointer-events: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .07); border: 1px solid var(--border); white-space: nowrap; }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; }
button.chip { cursor: pointer; color: var(--text); font-family: var(--font); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
.b-green { background: rgba(34, 255, 136, .14); color: var(--green); }
.b-cyan { background: rgba(0, 240, 255, .14); color: var(--cyan); }
.b-pink { background: rgba(255, 43, 214, .16); color: #ff7be6; }
.b-yellow { background: rgba(255, 225, 77, .15); color: var(--yellow); }
.b-red { background: rgba(255, 77, 109, .15); color: #ff8aa0; }
.b-violet { background: rgba(139, 92, 255, .2); color: #b9a2ff; }
.b-gray { background: rgba(255, 255, 255, .08); color: var(--muted); }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0; background: var(--grad); background-size: cover; background-position: center; box-shadow: 0 0 0 2px rgba(255, 255, 255, .08); }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatars { display: flex; } .avatars .avatar { margin-left: -8px; border: 2px solid var(--bg2); } .avatars .avatar:first-child { margin-left: 0; }

.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% auto; animation: shine 5s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.ua-text { background: var(--grad-ua); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* форми */
input, select, textarea { width: 100%; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--border); background: rgba(6, 4, 26, .55); color: var(--text); font: 500 14px var(--font); outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 240, 255, .15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--pink); }
input[type=color] { padding: 2px; height: 40px; }
select option { background: var(--panel-solid); }
textarea { min-height: 90px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.form { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .full { grid-column: 1 / -1; }
.search { max-width: 280px; }

/* таблиці */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; padding: 11px 12px; background: rgba(139, 92, 255, .08); white-space: nowrap; position: sticky; top: 0; }
td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(255, 255, 255, .025); }
td .row { flex-wrap: nowrap; }

/* KPI */
.kpi { padding: 18px; }
.kpi .v { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-top: 4px; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 700; }
.kpi .ico { position: absolute; right: 16px; top: 14px; font-size: 26px; opacity: .85; filter: drop-shadow(0 0 10px rgba(0, 240, 255, .5)); }
.progress { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 8px; box-shadow: 0 0 10px var(--cyan); transition: width .8s cubic-bezier(.2, .8, .2, 1); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; padding: 5px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); border-radius: 14px; width: fit-content; max-width: 100%; }
.tab { padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--muted); border: 0; background: none; font-family: var(--font); }
.tab.on { background: var(--grad); color: #fff; box-shadow: 0 0 14px rgba(255, 43, 214, .35); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .e { font-size: 44px; margin-bottom: 8px; }

/* hero */
.hero { padding: 32px; overflow: hidden; }
.hero h1 { margin-bottom: 8px; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgba(255, 43, 214, .25), transparent 45%), radial-gradient(circle at 10% 100%, rgba(0, 240, 255, .18), transparent 40%); pointer-events: none; border-radius: inherit; }
.hero > * { position: relative; }

/* курси / roadmap */
.course-card { overflow: hidden; }
.course-card .em { font-size: 40px; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); box-shadow: 0 0 22px color-mix(in srgb, var(--c, #8b5cff) 45%, transparent); border: 1px solid color-mix(in srgb, var(--c, #8b5cff) 50%, transparent); margin-bottom: 12px; }
.course-card .stripe { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c, var(--violet)); box-shadow: 0 0 14px var(--c); }
.stage { border-left: 2px solid var(--border-strong); padding: 0 0 16px 20px; position: relative; }
.stage::before { content: ''; position: absolute; left: -8px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.stage.done::before { background: var(--cyan); }
.topic { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); margin: 6px 0; cursor: pointer; transition: background .2s; }
.topic:hover { background: rgba(139, 92, 255, .12); }
.topic.done { border-color: rgba(34, 255, 136, .35); background: rgba(34, 255, 136, .07); }
.topic.done span { text-decoration: line-through; opacity: .75; }

/* візуалізація алгоритмів */
.viz { height: 220px; display: flex; align-items: flex-end; gap: 3px; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px solid var(--border); }
.viz .bar { flex: 1; background: var(--grad); border-radius: 4px 4px 0 0; transition: height .15s, background .15s; position: relative; min-width: 4px; }
.viz .bar.cmp { background: var(--yellow); box-shadow: 0 0 12px var(--yellow); }
.viz .bar.swap { background: var(--pink); box-shadow: 0 0 12px var(--pink); }
.viz .bar.ok { background: var(--green); }
.cells { display: flex; gap: 4px; flex-wrap: wrap; }
.cell { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); font-weight: 800; transition: all .25s; }
.cell.range { background: rgba(0, 240, 255, .12); border-color: var(--cyan); }
.cell.mid { background: var(--yellow); color: #111; box-shadow: 0 0 14px var(--yellow); }
.cell.found { background: var(--green); color: #052; box-shadow: 0 0 16px var(--green); }
.cell.out { opacity: .3; }
pre.code { background: rgba(0, 0, 0, .45); border: 1px solid var(--border); border-radius: 14px; padding: 16px; overflow-x: auto; font: 13px/1.6 'JetBrains Mono', Consolas, monospace; color: #c8f7ff; margin: 0; }

/* тест */
.quiz-opt { display: block; width: 100%; text-align: left; padding: 14px 18px; margin: 8px 0; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, .04); color: var(--text); font: 600 15px var(--font); cursor: pointer; transition: all .2s; }
.quiz-opt:hover { border-color: var(--cyan); background: rgba(0, 240, 255, .08); transform: translateX(6px); }
.quiz-opt.right { border-color: var(--green); background: rgba(34, 255, 136, .12); }
.quiz-opt.wrong { border-color: var(--red); background: rgba(255, 77, 109, .12); }
.score-bar { display: grid; grid-template-columns: 200px 1fr 50px; gap: 12px; align-items: center; margin: 8px 0; font-weight: 700; }

/* чат */
/* ---------- чати ---------- */
.chat { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 480px; padding: 0; overflow: hidden; }
.chat-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-list-top { padding: 12px 12px 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); }
.chat-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chat-filters::-webkit-scrollbar { display: none; }
.chat-items { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px 14px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer; color: inherit; text-decoration: none; }
.chat-item:hover { background: var(--panel2); text-decoration: none; }
.chat-item.on { background: rgba(139, 92, 255, .22); box-shadow: inset 0 0 0 1px var(--border-strong); }
.chat-item .meta { min-width: 0; flex: 1; }
.chat-item .r1, .chat-item .r2 { display: flex; align-items: center; gap: 6px; }
.chat-item .r1 b { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .t { flex: none; font-size: 11px; color: var(--muted); }
.chat-item .r2 small { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .cnt { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-head-t { flex: 1; min-width: 0; cursor: pointer; }
.chat-back { display: none; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-bar { display: flex; align-items: center; gap: 8px; padding: 7px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 225, 77, .06); }
.pin-bar[hidden] { display: none; }
.pin-bar .pb-t { flex: 1; min-width: 0; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.pin-bar .pb-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.msgs-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.chat .msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 18px; gap: 3px; overscroll-behavior: contain; }
.chat .msg { align-self: flex-start; max-width: min(80%, 720px); position: relative; align-items: flex-end; gap: 8px; animation: none; }
.chat .msg:not(.cont) { margin-top: 8px; }
.chat .msg.cont .avatar { visibility: hidden; }
.chat .msg .mcol { min-width: 0; }
.chat .msg .bubble { white-space: normal; overflow-wrap: anywhere; padding: 7px 12px 5px; }
.chat .msg .bubble .md p { margin: 0 0 4px; }
.chat .msg .bubble .md > :last-child { margin-bottom: 0; }
.chat .msg .bubble img { max-width: 100%; }
.chat .msg.cont:not(.me) .bubble { border-radius: 4px 16px 16px 4px; }
.chat .msg.cont.me .bubble { border-radius: 16px 4px 4px 16px; }
.mmeta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.msg.me .mmeta { color: rgba(255, 255, 255, .72); }
.mmeta .dup { background: rgba(255, 59, 92, .22); color: #ffb4c2; border-radius: 8px; padding: 0 6px; font-weight: 800; }
.mfile { display: inline-flex; gap: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .2); margin-top: 4px; }
.chat .msg.pinned .bubble { box-shadow: 0 0 0 1.5px rgba(255, 225, 77, .65); }
.chat .msg.flash .bubble { animation: msgFlash 1.4s; }
@keyframes msgFlash { 0%, 55% { box-shadow: 0 0 0 3px var(--cyan); } 100% { box-shadow: none; } }
.msg-actions { position: absolute; top: -16px; right: -6px; display: none; gap: 1px; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 10px; padding: 2px; z-index: 3; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.msg.me .msg-actions { right: auto; left: -6px; }
.chat .msg:hover .msg-actions, .chat .msg.show-actions .msg-actions { display: flex; }
.msg-actions button { border: 0; background: none; cursor: pointer; padding: 3px 6px; border-radius: 8px; font-size: 14px; color: inherit; line-height: 1.2; }
.msg-actions button:hover { background: rgba(255, 255, 255, .1); }
.reply-quote { border-left: 3px solid var(--cyan); padding: 3px 8px; margin: 2px 0 6px; border-radius: 4px; background: rgba(0, 0, 0, .2); cursor: pointer; font-size: 12.5px; display: grid; }
.reply-quote span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.me .reply-quote span { color: rgba(255, 255, 255, .75); }
.day-sep { text-align: center; margin: 14px 0 4px; position: sticky; top: 0; z-index: 2; }
.day-sep span { font-size: 11.5px; color: var(--muted); background: var(--panel-solid); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; }
.load-older { text-align: center; font-size: 12.5px; color: var(--cyan); cursor: pointer; padding: 6px; }
.jump { position: absolute; right: 18px; bottom: 14px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--panel-solid); color: var(--text); cursor: pointer; font-size: 18px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.jump[hidden] { display: none; }
.composer { border-top: 1px solid var(--border); }
.composer-note { padding: 14px 16px; text-align: center; font-size: 13px; color: #ffb4c2; background: rgba(255, 59, 92, .08); }
.composer-note.muted { color: var(--muted); background: none; }
.composer-note[hidden], .reply-bar[hidden], .chat-input[hidden] { display: none; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px 0; }
.reply-bar .rb-t { flex: 1; min-width: 0; border-left: 3px solid var(--cyan); padding-left: 8px; font-size: 12.5px; display: grid; }
.reply-bar .rb-t span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat .chat-input { align-items: flex-end; padding: 10px 12px; }
.chat .chat-input textarea { flex: 1; resize: none; min-height: 44px; max-height: 180px; line-height: 1.4; }
.ci-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.ci-desc { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.ci-members { display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.ci-m { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.ci-m:hover { background: var(--panel2); }
.ci-mn { flex: 1; min-width: 0; }
.ci-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ci-acts { display: grid; gap: 8px; }
.ci-acts .btn { justify-content: flex-start; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 10px; max-width: 78%; animation: fadeUp .3s both; }
.msg .bubble { padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: rgba(255, 255, 255, .07); border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word; }
.msg .bubble img { border-radius: 10px; max-height: 260px; display: block; margin-top: 6px; }
.msg .who { font-size: 12px; font-weight: 800; color: var(--cyan); margin-bottom: 2px; }
.msg .time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: linear-gradient(135deg, rgba(139, 92, 255, .55), rgba(255, 43, 214, .4)); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.ai-chat .msgs { min-height: 380px; max-height: 60vh; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); margin: 0 2px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; transform: translateY(-3px); } }
.md p:last-child { margin: 0; } .md ul { margin: 4px 0; padding-left: 20px; } .md code { background: rgba(0, 0, 0, .35); padding: 1px 5px; border-radius: 5px; }

/* календар */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { text-align: center; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 4px; }
.cal-d { min-height: 108px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; cursor: pointer; transition: background .2s; }
.cal-d:hover { background: rgba(139, 92, 255, .1); }
.cal-d.other { opacity: .35; }
.cal-d.today { border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 240, 255, .35) inset; }
.cal-d .n { font-weight: 800; font-size: 13px; }
.cal-ev { font-size: 11.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c, #8b5cff) 25%, transparent); border-left: 3px solid var(--c, var(--violet)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-more { font-size: 11px; color: var(--muted); }

/* канбан */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: rgba(255, 255, 255, .035); border: 1px solid var(--border); border-radius: 16px; padding: 12px; min-height: 300px; transition: background .2s; }
.kcol.over { background: rgba(0, 240, 255, .08); border-color: var(--cyan); }
.kcol h4 { font-size: 13px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ktask { background: var(--panel-solid); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; cursor: grab; transition: transform .15s, box-shadow .2s; }
.ktask:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.ktask.dragging { opacity: .4; }
.prio-high { border-left: 3px solid var(--red); } .prio-medium { border-left: 3px solid var(--yellow); } .prio-low { border-left: 3px solid var(--green); }

/* дошка (Miro-подібна) */
.wb-wrap { position: relative; height: calc(100vh - 210px); min-height: 500px; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background-color: #0b0826; background-image: radial-gradient(rgba(150, 130, 255, .25) 1px, transparent 1px); background-size: 24px 24px; cursor: grab; }
.wb-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wb-item { position: absolute; border-radius: 6px; padding: 12px; font-weight: 600; color: #1a1033; box-shadow: 0 8px 22px rgba(0, 0, 0, .35); cursor: move; overflow: hidden; white-space: pre-wrap; outline: none; }
.wb-item.text { background: transparent !important; box-shadow: none; color: #fff; font-family: var(--font-display); font-size: 22px; }
.wb-item.circle { border-radius: 50%; display: grid; place-items: center; text-align: center; }
.wb-item.sel { outline: 2px solid var(--cyan); box-shadow: 0 0 22px var(--cyan); }
.wb-item .rs { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, .35) 50%); }
.wb-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.wb-tools { position: absolute; left: 14px; top: 14px; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: rgba(13, 9, 48, .9); border: 1px solid var(--border); border-radius: 14px; }
.wb-tools .btn.on { background: var(--grad); border-color: transparent; }

/* медіа / галерея */
.media-frame { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #000; }
.media-frame.vertical { aspect-ratio: 9/16; max-height: 560px; }
.media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.channel { display: flex; align-items: center; gap: 14px; }
.channel .pi { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; }
.masonry { columns: 3 280px; column-gap: 16px; }
.masonry .ph { break-inside: avoid; margin-bottom: 16px; border-radius: 16px; overflow: hidden; position: relative; cursor: zoom-in; border: 1px solid var(--border); }
.masonry .ph img { display: block; width: 100%; transition: transform .6s; }
.masonry .ph:hover img { transform: scale(1.06); }
.masonry .ph .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); font-weight: 700; opacity: 0; transform: translateY(10px); transition: all .3s; }
.masonry .ph:hover .cap { opacity: 1; transform: none; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .9); display: grid; place-items: center; padding: 30px; animation: fadeUp .25s; cursor: zoom-out; }
.lightbox img { max-height: 88vh; border-radius: 14px; box-shadow: 0 0 60px rgba(139, 92, 255, .5); }

/* новини */
.news-card .img { height: 170px; border-radius: 12px; margin: -4px -4px 14px; background: var(--grad); background-size: cover; background-position: center; display: grid; place-items: center; font-size: 60px; }

/* модалка, тост */
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(3, 2, 15, .7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(720px, 100%); max-height: 92vh; overflow-y: auto; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 22px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), var(--glow); animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); }
.modal.wide { width: min(1000px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow), var(--glow); font-weight: 700; animation: fadeUp .3s; max-width: 360px; }
.toast.err { border-color: var(--red); }

/* лендінг / логін */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.land-nav { display: flex; align-items: center; gap: 14px; padding: 18px 32px; }
.land-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 40px 32px 60px; max-width: 1300px; margin: 0 auto; width: 100%; }
.land-hero h1 { font-size: clamp(34px, 5.5vw, 64px); line-height: 1.05; }
.land-hero .lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.logo-orb { width: 140px; height: 140px; border-radius: 34px; background: #2d1468; display: grid; place-items: center; font-size: 70px; box-shadow: 0 0 60px rgba(255, 225, 77, .35), 0 0 120px rgba(43, 140, 255, .25); animation: bob 5s ease-in-out infinite; margin-bottom: 26px; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-3deg); } }
.login-card { padding: 28px; }
.demo-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.land-section { max-width: 1300px; margin: 0 auto; padding: 30px 32px; width: 100%; }
.marquee { overflow: hidden; white-space: nowrap; padding: 16px 0; border-block: 1px solid var(--border); }
.marquee div { display: inline-block; animation: marq 40s linear infinite; }
.marquee span { margin: 0 24px; font-family: var(--font-display); font-size: 18px; opacity: .8; }
@keyframes marq { to { transform: translateX(-50%); } }

.doc-content h2 { font-size: 18px; margin-top: 18px; } .doc-content ul, .doc-content ol { padding-left: 22px; }
.notion-frame { width: 100%; height: 70vh; border: 0; border-radius: 14px; background: #fff; }

.print-only { display: none; }

/* адаптив */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .land-hero { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .7); }
  .burger { display: inline-flex; }
  .view { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .g2, .g3, .g4, .form { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 176px); height: calc(100dvh - 176px - env(safe-area-inset-bottom)); min-height: 380px; margin-bottom: -60px; }
  .chat .chat-main { display: none; }
  .chat.open-main .chat-list { display: none; }
  .chat.open-main .chat-main { display: flex; }
  .chat-list { border-right: 0; }
  .chat-back { display: inline-flex; }
  .chat .msg { max-width: 90%; }
  .chat .msgs { padding: 10px 10px 14px; }
  .cal-d { min-height: 70px; } .cal-ev { font-size: 10px; }
  .score-bar { grid-template-columns: 120px 1fr 40px; }
  .land-nav, .land-hero, .land-section { padding-left: 16px; padding-right: 16px; }
}
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .no-print, .bg-blobs, #bg-canvas { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; background: #fff; }
}
.brand-logo img, .logo-orb img { width: 100%; height: 100%; object-fit: cover; }
.masonry .ph .ph-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.masonry .ph:hover .ph-tools { opacity: 1; }
@media (hover: none) { .masonry .ph .ph-tools { opacity: 1; } }

/* ексклюзивні матеріали */
.mat-hero::after { content: "💎"; position: absolute; right: -10px; bottom: -30px; font-size: 160px; opacity: .07; transform: rotate(-15deg); pointer-events: none; }
.mat-card { padding: 14px; overflow: hidden; }
.mat-cover { position: relative; height: 150px; border-radius: 12px; background: linear-gradient(135deg, rgba(0,240,255,.25), rgba(139,92,255,.35), rgba(255,43,214,.3)); background-size: cover; background-position: center; display: grid; place-items: center; overflow: hidden; }
.mat-cover > span { font-size: 58px; filter: drop-shadow(0 0 18px rgba(0,240,255,.6)); transition: transform .4s; }
.mat-card:hover .mat-cover > span { transform: scale(1.15) rotate(-6deg); }
.mat-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); transform: translateX(-100%); transition: transform .8s; }
.mat-card:hover .mat-cover::after { transform: translateX(100%); }
.mat-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.mat-check { position: absolute; top: 8px; right: 8px; font-size: 22px; }
.mat-done { border-color: rgba(34,255,136,.45); }
.chan-card { display: flex; gap: 14px; align-items: center; color: inherit; text-decoration: none; }
.chan-card:hover { text-decoration: none; }
.chan-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; flex: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.mat-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 300px); gap: 16px; overflow-x: auto; padding-bottom: 8px; }

/* дошка ідей v2 */
.wb2 { position: relative; height: calc(100vh - 230px); min-height: 520px; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background-color: #0b0826; background-image: radial-gradient(rgba(150,130,255,.28) 1px, transparent 1px); background-size: 24px 24px; touch-action: none; user-select: none; outline: none; cursor: default; }
.wb2[data-tool="hand"], .wb2.panning { cursor: grab; } .wb2.panning:active { cursor: grabbing; }
.wb2[data-tool="pen"], .wb2[data-tool="sticky"], .wb2[data-tool="text"], .wb2[data-tool="rect"], .wb2[data-tool="circle"], .wb2[data-tool="frame"], .wb2[data-tool="arrow"] { cursor: crosshair; }
.wb2[data-tool="eraser"] { cursor: cell; }
.wb2-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wb2-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.wb2-item { position: absolute; border-radius: 6px; padding: 10px 12px; box-sizing: border-box; overflow: hidden; font-weight: 600; line-height: 1.3; }
.wb2-item .wb2-text { white-space: pre-wrap; word-break: break-word; pointer-events: none; }
.wb2-item.k-sticky { box-shadow: 0 10px 24px rgba(0,0,0,.35); border-radius: 4px 4px 4px 18px; }
.wb2-item.k-text { padding: 2px 4px; font-family: var(--font-display); }
.wb2-item.k-circle { border-radius: 50%; display: grid; place-items: center; text-align: center; }
.wb2-item.k-rect { display: grid; place-items: center; text-align: center; }
.wb2-item.k-frame { border-radius: 14px; padding: 8px 14px; font-family: var(--font-display); overflow: visible; }
.wb2-item.k-image { padding: 0; } .wb2-item.k-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; pointer-events: none; }
.wb2-item.sel { outline: 2px solid #00f0ff; outline-offset: 2px; box-shadow: 0 0 22px rgba(0,240,255,.6); }
.wb2-rs { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 4px; background: #00f0ff; cursor: nwse-resize; box-shadow: 0 0 10px #00f0ff; }
.wb2-marquee { position: absolute; border: 1.5px dashed #00f0ff; background: rgba(0,240,255,.08); pointer-events: none; }
.wb2-editor { position: absolute; z-index: 20; border: 2px solid #00f0ff; border-radius: 6px; padding: 10px 12px; font: 600 16px/1.3 var(--font); resize: none; box-shadow: 0 0 24px rgba(0,240,255,.5); min-height: 0; }
.wb2-tools { position: absolute; left: 12px; top: 12px; z-index: 10; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: rgba(13,9,48,.92); border: 1px solid var(--border); border-radius: 14px; max-height: calc(100% - 24px); overflow-y: auto; }
.wb2-tools .btn.on { background: var(--grad); border-color: transparent; box-shadow: 0 0 14px rgba(255,43,214,.45); }
.wb2-tools hr { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.wb2-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.wb2-color { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.wb2-color.on { border-color: #fff; box-shadow: 0 0 10px #fff; }
.wb2-selbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 4px; padding: 6px; background: rgba(13,9,48,.92); border: 1px solid var(--border); border-radius: 12px; }
.wb2-top { position: absolute; top: 12px; right: 12px; z-index: 10; display: flex; gap: 4px; }
.wb2-zoom { position: absolute; right: 12px; bottom: 12px; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(13,9,48,.92); border: 1px solid var(--border); border-radius: 12px; font-weight: 700; font-size: 13px; }
@media (max-width: 860px) { .wb2 { height: calc(100vh - 200px); } .wb2-selbar { top: auto; bottom: 60px; } }

/* ---------- спільні дошки, таск-трекер, пошук у списках ---------- */
.multi-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.multi-top .multi-q { flex: 1; min-width: 0; }
.multi-list label.on { border-color: var(--cyan); background: rgba(0, 240, 255, .1); }
.multi-list label[hidden] { display: none; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: rgba(255, 255, 255, .14); cursor: pointer; transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--violet); }
.switch input:checked + span::after { transform: translateX(20px); }
.share-results { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; padding: 4px; }
.share-list { display: grid; gap: 2px; max-height: 300px; overflow: auto; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.share-row:hover { background: var(--panel2); }
.share-n { flex: 1; min-width: 0; display: grid; }
.share-n b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.avatar-stack { display: inline-flex; align-items: center; cursor: pointer; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--panel-solid); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.board-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 7px 12px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.seg button.on { background: var(--violet); color: #fff; }
.kadd { width: 100%; border: 1px dashed var(--border-strong); background: none; color: var(--muted); border-radius: 12px; padding: 9px; cursor: pointer; font: inherit; font-size: 13px; }
.kadd:hover { color: var(--text); border-color: var(--cyan); background: rgba(0, 240, 255, .05); }
.ktask.prio-high { border-left: 3px solid var(--red); }
.ktask.prio-medium { border-left: 3px solid var(--yellow); }
.ktask.prio-low { border-left: 3px solid var(--green); }
.ktask:not([draggable]) { cursor: pointer; }
[data-goto] .ktask { cursor: pointer; height: 100%; }
.tv-check { display: grid; gap: 6px; }
.tv-comments { display: grid; gap: 10px; max-height: 320px; overflow: auto; }
.tv-c { display: flex; gap: 10px; align-items: flex-start; }
.tv-c .md p { margin: 2px 0; }
.wb2.readonly .wb2-tools, .wb2.readonly .wb2-selbar, .wb2.readonly .wb2-top { display: none; }
.wb2.readonly { cursor: grab; }
.join-card h1 { font-family: var(--font-display); }

/* ---------- аналітика: космос місяців і цифровий простір місяця ---------- */
.cosmos { position: relative; height: min(68vh, 640px); min-height: 460px; overflow: hidden; padding: 0;
  background: radial-gradient(ellipse at center, rgba(139, 92, 255, .22), transparent 60%), radial-gradient(circle at 20% 80%, rgba(0, 240, 255, .1), transparent 40%), #07051c; }
.cosmos::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 120px 80px, rgba(255,255,255,.7), transparent), radial-gradient(1.5px 1.5px at 200px 150px, rgba(0,240,255,.8), transparent), radial-gradient(1px 1px at 300px 40px, rgba(255,255,255,.6), transparent); background-size: 340px 200px; opacity: .55; animation: starDrift 80s linear infinite; }
@keyframes starDrift { to { background-position: 340px 200px; } }
.cosmos-orbit { position: absolute; left: 8%; right: 8%; top: 14%; bottom: 14%; border: 1px dashed rgba(150, 130, 255, .25); border-radius: 50%; }
.cosmos-orbit.o2 { left: 30%; right: 30%; top: 32%; bottom: 32%; border-color: rgba(0, 240, 255, .14); animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sun { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 35% 35%, #fff6b0, #ffb020 45%, #ff2bd6 100%); box-shadow: 0 0 60px rgba(255, 176, 32, .55), 0 0 140px rgba(255, 43, 214, .3); animation: pulse 4s ease-in-out infinite; }
.sun img { width: 54px; height: 54px; border-radius: 12px; } .sun span { position: absolute; bottom: -26px; white-space: nowrap; font-weight: 800; font-size: 13px; color: var(--text); }
@keyframes pulse { 50% { box-shadow: 0 0 80px rgba(255, 176, 32, .7), 0 0 170px rgba(255, 43, 214, .38); } }
.planet { position: absolute; transform: translate(-50%, -50%); border: 0; background: none; cursor: pointer; color: var(--text); display: grid; justify-items: center; gap: 6px; padding: 0; z-index: 2; animation: bob 6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes bob { 50% { transform: translate(-50%, calc(-50% - 8px)); } }
.planet .orb { width: var(--s); height: var(--s); border-radius: 50%; transition: transform .25s, box-shadow .25s; }
.planet.p-pos .orb { background: radial-gradient(circle at 30% 30%, #b8fff1, #19c08a 45%, #0b4a63 100%); box-shadow: 0 0 22px rgba(25, 192, 138, .5); }
.planet.p-neg .orb { background: radial-gradient(circle at 30% 30%, #ffd2b8, #e0632b 45%, #5a1530 100%); box-shadow: 0 0 22px rgba(224, 99, 43, .5); }
.planet.p-neu .orb { background: radial-gradient(circle at 30% 30%, #e2d8ff, #7d5cff 45%, #1d1150 100%); box-shadow: 0 0 22px rgba(125, 92, 255, .45); }
.planet.now .orb { outline: 2px solid var(--cyan); outline-offset: 6px; }
.planet:hover .orb, .planet:focus-visible .orb { transform: scale(1.12); box-shadow: 0 0 40px rgba(0, 240, 255, .6); }
.planet .pl { font-size: 13px; line-height: 1.2; text-align: center; background: rgba(7, 5, 28, .75); padding: 3px 8px; border-radius: 10px; border: 1px solid var(--border); }
.planet .pl small { display: block; color: var(--muted); font-size: 10.5px; }
.cosmos-legend { position: absolute; left: 14px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px; z-index: 3; }
.pdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.pdot.pos { background: #19c08a; } .pdot.neg { background: #e0632b; } .pdot.neu { background: #7d5cff; }
.an-svg { width: 100%; height: auto; display: block; } .an-hit:hover path { filter: brightness(1.25); }
.an-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.an-spark { margin-bottom: 10px; }
.an-hbars { display: grid; gap: 8px; } .an-hb { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.an-hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .an-hb-t { height: 10px; background: rgba(255, 255, 255, .06); border-radius: 5px; overflow: hidden; } .an-hb-t i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.an-d { font-size: 12px; font-weight: 800; color: var(--muted); } .an-d.up { color: #3fd9a3; } .an-d.down { color: #ff8a6b; }
.an-load { height: 8px; background: rgba(255, 255, 255, .06); border-radius: 4px; overflow: hidden; margin-bottom: 2px; } .an-load i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.an-top { padding: 6px 0; border-bottom: 1px solid var(--border); } .an-top:last-child { border: 0; }
.an-sec { margin-top: 22px; } .an-sec > h2 { margin: 0 0 12px; }
.month-space { position: relative; }
.ms-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: radial-gradient(ellipse at 15% 0%, rgba(0, 240, 255, .18), transparent 55%), radial-gradient(ellipse at 90% 100%, rgba(255, 43, 214, .18), transparent 55%), #0b0826; }
.ms-title small { color: var(--cyan); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; } .ms-title h1 { margin: 0; }
.ms-tabs { margin-top: 12px; flex-wrap: wrap; }
.ai-panel { border-color: rgba(0, 240, 255, .35); } .ai-out { padding: 12px 16px; border-radius: 12px; background: rgba(0, 240, 255, .05); border: 1px solid rgba(0, 240, 255, .2); }
.cosmos-stage { position: relative; height: 100%; }
@media (max-width: 760px) {
  .cosmos { height: auto; min-height: 0; padding-bottom: 12px; }
  .cosmos-stage { height: 470px; }
  .planet .orb { width: calc(var(--s) * .58); height: calc(var(--s) * .58); }
  .planet .pl { font-size: 11px; padding: 2px 6px; } .planet .pl small { display: none; }
  .sun { width: 78px; height: 78px; } .sun img { width: 36px; height: 36px; } .sun span { font-size: 11px; bottom: -22px; }
  .cosmos-legend { position: static; padding: 0 14px; gap: 8px; }
}

/* ---------- голосовий помічник ---------- */
.voice { position: fixed; right: 18px; bottom: 18px; z-index: 900; }
.vo-fab { width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; font-size: 24px; color: #fff; background: var(--grad); box-shadow: 0 10px 30px rgba(139, 92, 255, .55); transition: transform .2s; }
.vo-fab:hover { transform: scale(1.08); }
.voice.open .vo-fab { display: none; }
.vo-panel { display: none; width: min(380px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 110px)); flex-direction: column; background: rgba(13, 9, 48, .97); border: 1px solid var(--border-strong); border-radius: 22px; box-shadow: var(--shadow), var(--glow); overflow: hidden; }
.voice.open .vo-panel { display: flex; }
.vo-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.vo-orb-wrap { display: grid; justify-items: center; gap: 8px; padding: 18px 14px 10px; text-align: center; }
.vo-orb { width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer; font-size: 34px; color: #fff; background: radial-gradient(circle at 35% 30%, #b9f6ff, #8b5cff 55%, #3a1a9e); box-shadow: 0 0 30px rgba(139, 92, 255, .5); transition: transform .2s; }
.vo-orb[data-s="listening"] { background: radial-gradient(circle at 35% 30%, #c9fff0, #00d4b0 55%, #035e66); animation: voPulse 1.1s ease-in-out infinite; }
.vo-orb[data-s="thinking"] { animation: spin 1.6s linear infinite; }
.vo-orb[data-s="speaking"] { background: radial-gradient(circle at 35% 30%, #ffe1f7, #ff2bd6 55%, #6a0a5c); animation: voPulse .7s ease-in-out infinite; }
@keyframes voPulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(0, 240, 255, .12), 0 0 50px rgba(0, 240, 255, .45); } }
.vo-interim { min-height: 18px; font-size: 13px; color: var(--cyan); }
.vo-log { flex: 1; overflow: auto; padding: 4px 14px 10px; display: grid; gap: 8px; align-content: start; min-height: 80px; }
.vo-m { padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; max-width: 92%; }
.vo-m.user { justify-self: end; background: var(--violet); color: #fff; border-bottom-right-radius: 4px; }
.vo-m.assistant { background: rgba(255, 255, 255, .06); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.vo-foot { padding: 10px 14px 14px; border-top: 1px solid var(--border); }
@media (max-width: 860px) { .voice { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; } .vo-fab { width: 50px; height: 50px; font-size: 21px; } }
@media print { .voice { display: none; } }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ig-post { aspect-ratio: 1; border-radius: 14px; background: #1a1240 center / cover no-repeat; position: relative; overflow: hidden; border: 1px solid var(--border); }
.ig-post span { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; }

/* Календар школи: на телефоні — сітка на всю ширину, список подій під нею */
.cal-layout { grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); }
@media (max-width: 900px) { .cal-layout { grid-template-columns: minmax(0, 1fr); } }
