/* ============ Synapsa – ciemny motyw z fioletem, błękitem i różem ============ */
:root {
  --bg: #08070f;
  --bg-2: #0e0c19;
  --surface: rgba(22, 19, 38, .72);
  --surface-solid: #161326;
  --surface-2: #1d1932;
  --surface-3: #262043;
  --border: rgba(167, 139, 250, .12);
  --border-strong: rgba(167, 139, 250, .26);
  --text: #eeeaff;
  --muted: #9b94bd;
  --faint: #6b6590;
  --violet: #8b5cf6;
  --violet-l: #a78bfa;
  --blue: #3b82f6;
  --blue-l: #60a5fa;
  --pink: #ec4899;
  --pink-l: #f472b6;
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 50%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(59, 130, 246, .14) 50%, rgba(236, 72, 153, .2));
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7), 0 0 0 1px var(--border);
  --glow: 0 0 0 1px rgba(167, 139, 250, .35), 0 8px 30px -6px rgba(139, 92, 246, .45);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
a { color: var(--violet-l); text-decoration: none; }
a:hover { color: var(--pink-l); }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: rgba(236, 72, 153, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(167, 139, 250, .18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(167, 139, 250, .32); }
::-webkit-scrollbar-track { background: transparent; }
[hidden] { display: none !important; }

/* ---------- tło ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-blobs span { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .32; animation: float 26s ease-in-out infinite; }
.bg-blobs span:nth-child(1) { width: 560px; height: 560px; background: #7c3aed; top: -180px; left: -120px; }
.bg-blobs span:nth-child(2) { width: 480px; height: 480px; background: #2563eb; bottom: -200px; right: 10%; animation-delay: -8s; }
.bg-blobs span:nth-child(3) { width: 420px; height: 420px; background: #db2777; top: 30%; right: -160px; animation-delay: -16s; opacity: .22; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(60px, 40px) scale(1.08); } 66% { transform: translate(-40px, 30px) scale(.95); } }
body::after { /* delikatny szum/siatka */
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
#app { position: relative; z-index: 1; height: 100%; }

/* ---------- elementy wspólne ---------- */
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer;
  font-weight: 600; font-size: 13.5px; transition: .18s ease; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-3); border-color: rgba(167, 139, 250, .45); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { border: 0; background: var(--grad); background-size: 160% 160%; color: #fff; box-shadow: 0 8px 24px -8px rgba(139, 92, 246, .7); }
.btn.primary:hover { background-position: 100% 50%; box-shadow: 0 10px 30px -6px rgba(236, 72, 153, .6); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(167, 139, 250, .1); color: var(--text); }
.btn.danger { color: var(--red); border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .08); }
.btn.danger:hover { background: rgba(248, 113, 113, .16); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.field .hint { font-size: 12px; color: var(--faint); }
.input, textarea.input, select.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: rgba(8, 7, 15, .6); outline: none; transition: .18s;
}
textarea.input { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--violet-l); box-shadow: 0 0 0 4px rgba(139, 92, 246, .18); background: rgba(8, 7, 15, .85); }
.input::placeholder { color: var(--faint); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; background: rgba(167, 139, 250, .12); color: var(--violet-l); border: 1px solid rgba(167, 139, 250, .2);
}
.chip svg { width: 12px; height: 12px; }
.chip.blue { background: rgba(96, 165, 250, .12); color: var(--blue-l); border-color: rgba(96, 165, 250, .22); }
.chip.pink { background: rgba(244, 114, 182, .12); color: var(--pink-l); border-color: rgba(244, 114, 182, .22); }
.chip.green { background: rgba(52, 211, 153, .1); color: var(--green); border-color: rgba(52, 211, 153, .22); }
.chip.amber { background: rgba(251, 191, 36, .1); color: var(--amber); border-color: rgba(251, 191, 36, .22); }
.chip.red { background: rgba(248, 113, 113, .1); color: var(--red); border-color: rgba(248, 113, 113, .25); }
.empty {
  text-align: center; padding: 48px 24px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted);
}
.empty .big-ico { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--grad-soft); color: var(--violet-l); }
.empty .big-ico svg { width: 26px; height: 26px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-family: var(--display); }
.empty p { margin: 0 0 18px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- ekran startowy ---------- */
.landing { height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 6vh 20px 40px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 26px -6px rgba(139, 92, 246, .8); }
.brand-logo svg { width: 22px; height: 22px; color: #fff; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.hero { text-align: center; max-width: 720px; margin: 7vh 0 40px; }
.hero h1 { font-family: var(--display); font-size: clamp(34px, 6vw, 60px); line-height: 1.02; letter-spacing: -.035em; margin: 18px 0 16px; }
.hero p { font-size: 17px; color: var(--muted); margin: 0 auto; max-width: 560px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: rgba(139, 92, 246, .12); border: 1px solid rgba(167, 139, 250, .25); font-size: 12.5px; font-weight: 600; color: var(--violet-l); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 400px)); gap: 20px; width: 100%; justify-content: center; }
.auth-card { padding: 28px; position: relative; overflow: hidden; }
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); opacity: .9; }
.auth-card.alt::before { background: linear-gradient(90deg, #ec4899, #8b5cf6); }
.auth-card h2 { font-family: var(--display); margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
.auth-card .btn { width: 100%; height: 44px; margin-top: 6px; }
.recent { width: 100%; max-width: 820px; margin-top: 28px; }
.recent h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.recent-list { display: flex; flex-wrap: wrap; gap: 10px; }
.recent-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; cursor: pointer; transition: .18s; }
.recent-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.recent-item .av { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--grad); color: #fff; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; max-width: 820px; margin-top: 48px; }
.feature { padding: 18px; }
.feature .fi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--pink-l); margin-bottom: 10px; }
.feature .fi svg { width: 17px; height: 17px; }
.feature b { display: block; margin-bottom: 4px; font-family: var(--display); }
.feature span { color: var(--muted); font-size: 13px; }

/* ---------- powłoka aplikacji ---------- */
.shell { display: grid; grid-template-columns: 300px 1fr; grid-template-rows: 62px 1fr; height: 100%; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 18px;
  border-bottom: 1px solid var(--border); background: rgba(8, 7, 15, .65); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); z-index: 20;
}
.topbar .brand-logo { width: 32px; height: 32px; border-radius: 10px; }
.topbar .brand-logo svg { width: 18px; height: 18px; }
.group-badge { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.group-badge b { font-family: var(--display); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.group-badge span { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.search .input { height: 38px; padding-left: 38px; background: rgba(22, 19, 38, .7); }
.search > svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 9px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--muted); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; max-height: 60vh; overflow-y: auto; padding: 6px; box-shadow: var(--shadow); background: var(--surface-solid); z-index: 40; }
.sr-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.sr-item:hover, .sr-item.active { background: rgba(139, 92, 246, .14); }
.sr-item .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.sr-item .ico svg { width: 15px; height: 15px; }
.sr-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item .p { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item mark { background: rgba(236, 72, 153, .3); color: inherit; border-radius: 3px; padding: 0 2px; }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 99px; border: 1px solid var(--border); cursor: pointer; transition: .18s; }
.me:hover { border-color: var(--border-strong); background: var(--surface-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; }
.me span { font-size: 13px; font-weight: 600; padding-right: 6px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- pasek boczny / drzewo ---------- */
.sidebar { border-right: 1px solid var(--border); background: rgba(10, 9, 19, .55); backdrop-filter: blur(14px); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px 18px; }
.side-head h5 { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.side-nav { padding: 6px 10px 2px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 500; transition: .15s; }
.nav-item:hover { background: rgba(167, 139, 250, .08); color: var(--text); }
.nav-item.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .25); }
.nav-item svg { width: 17px; height: 17px; }
.tree { flex: 1; overflow-y: auto; padding: 4px 8px 20px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { margin-left: 14px; padding-left: 6px; border-left: 1px solid rgba(167, 139, 250, .1); }
.t-row { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 4px; border-radius: 9px; cursor: pointer; color: var(--muted); position: relative; transition: background .12s; }
.t-row:hover { background: rgba(167, 139, 250, .08); color: var(--text); }
.t-row.active { background: rgba(139, 92, 246, .18); color: #fff; }
.t-row.active::before { content: ''; position: absolute; left: -7px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--grad); }
.t-caret { width: 18px; height: 18px; display: grid; place-items: center; flex: none; color: var(--faint); border-radius: 5px; transition: transform .18s; }
.t-caret svg { width: 13px; height: 13px; }
.t-caret.open { transform: rotate(90deg); }
.t-caret.none { visibility: hidden; }
.t-ico { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.t-ico svg { width: 15px; height: 15px; }
.t-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.t-count { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.t-actions { display: none; gap: 2px; }
.t-row:hover .t-actions { display: flex; }
.t-row:hover .t-count { display: none; }
.t-act { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--faint); border: 0; background: none; cursor: pointer; }
.t-act:hover { background: rgba(167, 139, 250, .2); color: #fff; }
.t-act svg { width: 14px; height: 14px; }
.side-foot { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.side-foot .btn { flex: 1; }

/* kolory typów */
.c-folder { color: var(--blue-l); }
.c-subject { color: var(--pink-l); }
.c-section { color: var(--violet-l); }
.c-topic { color: var(--cyan); }

/* ---------- główny obszar ---------- */
.main { overflow-y: auto; min-height: 0; position: relative; }
.page { max-width: 1120px; margin: 0 auto; padding: 26px 34px 80px; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--faint); margin-bottom: 14px; }
.crumbs a { color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.crumbs a:hover { background: rgba(167, 139, 250, .1); color: var(--text); }
.crumbs svg { width: 12px; height: 12px; }
.page-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.page-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .25); }
.page-ico svg { width: 26px; height: 26px; }
.page-title { flex: 1; min-width: 240px; }
.page-title h1 { font-family: var(--display); font-size: 30px; letter-spacing: -.03em; line-height: 1.15; margin: 2px 0 6px; }
.page-title .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-title h2 { font-family: var(--display); font-size: 18px; margin: 0; letter-spacing: -.02em; }
.section-title .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

/* hero tablicy */
.board-hero { padding: 28px 30px; position: relative; overflow: hidden; margin-bottom: 22px; }
.board-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; background: var(--grad); filter: blur(70px); opacity: .35; }
.board-hero h1 { font-family: var(--display); font-size: 34px; margin: 6px 0 8px; letter-spacing: -.035em; position: relative; }
.board-hero p { margin: 0; color: var(--muted); position: relative; max-width: 560px; }
.code-box { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; position: relative; padding: 8px 8px 8px 14px; border-radius: 12px; background: rgba(8, 7, 15, .55); border: 1px solid var(--border-strong); font-family: var(--mono); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.stat { padding: 16px 18px; }
.stat .v { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.stat .sico { float: right; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); }
.stat .sico svg { width: 17px; height: 17px; }
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }

/* mapa – drzewo genealogiczne */
.map-wrap { padding: 26px 18px; overflow-x: auto; }
.map, .map ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; }
.map ul { padding-top: 22px; position: relative; }
.map li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 22px 6px 0; }
.map > li { padding-top: 0; }
.map li::before, .map li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 1.5px solid rgba(167, 139, 250, .35); }
.map li::after { right: auto; left: 50%; border-left: 1.5px solid rgba(167, 139, 250, .35); }
.map li:only-child::before, .map li:only-child::after { display: none; }
.map li:only-child { padding-top: 22px; }
.map > li:only-child { padding-top: 0; }
.map li:first-child::before, .map li:last-child::after { border: 0 none; }
.map li:last-child::before { border-right: 1.5px solid rgba(167, 139, 250, .35); border-radius: 0 10px 0 0; }
.map li:first-child::after { border-radius: 10px 0 0 0; }
.map ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1.5px solid rgba(167, 139, 250, .35); }
.map li:only-child > .m-node::before { content: ''; position: absolute; top: -22px; left: 50%; height: 22px; border-left: 1.5px solid rgba(167, 139, 250, .35); }
.map > li:only-child > .m-node::before { display: none; }
.m-node {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; cursor: pointer; white-space: nowrap;
  background: var(--surface-solid); border: 1px solid var(--border-strong); font-weight: 600; font-size: 13px; transition: .18s; max-width: 220px;
}
.m-node span { overflow: hidden; text-overflow: ellipsis; }
.m-node:hover { box-shadow: var(--glow); transform: translateY(-2px); }
.m-node svg { width: 15px; height: 15px; flex: none; }
.m-node.root { background: var(--grad); border: 0; color: #fff; font-size: 15px; padding: 12px 20px; box-shadow: 0 10px 30px -8px rgba(139, 92, 246, .7); }
.m-node.subject { border-color: rgba(244, 114, 182, .4); }
.m-node .cnt { font-family: var(--mono); font-size: 11px; color: var(--faint); font-weight: 500; }

/* siatka kart */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { padding: 18px; cursor: pointer; transition: .2s ease; position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 132px; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--glow); border-color: transparent; }
.tile .ti { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); margin-bottom: 14px; }
.tile .ti svg { width: 19px; height: 19px; }
.tile h3 { margin: 0 0 4px; font-size: 15.5px; font-family: var(--display); letter-spacing: -.01em; }
.tile .sub { color: var(--muted); font-size: 12.5px; margin-top: auto; padding-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.tile .bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.tile.add { border-style: dashed; border-color: var(--border-strong); background: transparent; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.tile.add:hover { color: var(--text); background: rgba(139, 92, 246, .06); }
.tile.add .ti { margin: 0 0 10px; }

/* przedmiot */
.subject-hero { padding: 26px 28px; position: relative; overflow: hidden; margin-bottom: 18px; }
.subject-hero .glow { position: absolute; inset: auto -80px -120px auto; width: 300px; height: 300px; border-radius: 50%; filter: blur(80px); opacity: .35; }
.info-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.info-card { padding: 20px 22px; }
.info-card h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.info-card h4 svg { width: 15px; height: 15px; color: var(--pink-l); }
.info-card .prose { font-size: 14px; }
.exam { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 12px; background: rgba(8, 7, 15, .45); border: 1px solid var(--border); margin-bottom: 8px; }
.exam .date { width: 50px; text-align: center; flex: none; padding: 6px 0; border-radius: 10px; background: var(--grad-soft); line-height: 1.1; }
.exam .date b { display: block; font-family: var(--display); font-size: 19px; }
.exam .date span { font-size: 10.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.exam .what { flex: 1; min-width: 0; }
.exam .what b { display: block; font-size: 14px; }
.exam .what span { font-size: 12px; color: var(--muted); }
.exam.past { opacity: .45; }
.links a { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13.5px; }
.links a svg { width: 14px; height: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.sec-card { padding: 18px; }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sec-head .ti { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); }
.sec-head .ti svg { width: 16px; height: 16px; }
.sec-head h3 { margin: 0; font-size: 15.5px; font-family: var(--display); flex: 1; cursor: pointer; }
.sec-head h3:hover { color: var(--violet-l); }
.topic-list { display: flex; flex-direction: column; gap: 4px; }
.topic-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: .15s; border: 1px solid transparent; }
.topic-row:hover { background: rgba(139, 92, 246, .1); border-color: var(--border); }
.topic-row .num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: 11.5px; background: var(--surface-3); color: var(--muted); flex: none; }
.topic-row .tt { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-row .badges { display: flex; gap: 4px; }
.dotc { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.dotc svg { width: 13px; height: 13px; }
.dotc.has { color: var(--violet-l); }

/* temat – notatki */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.note-card { padding: 18px; cursor: pointer; transition: .2s; display: flex; flex-direction: column; gap: 10px; position: relative; min-height: 190px; }
.note-card:hover { transform: translateY(-3px); box-shadow: var(--glow); border-color: transparent; }
.note-card .nh { display: flex; align-items: center; gap: 8px; }
.note-card h3 { margin: 0; font-size: 16px; font-family: var(--display); letter-spacing: -.01em; line-height: 1.3; }
.note-card .preview { color: var(--muted); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; flex: 1; }
.note-card .nf { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); margin-top: auto; }
.note-card .file-thumb { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(8, 7, 15, .45); border: 1px solid var(--border); }
.file-ext { width: 42px; height: 50px; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 11px; color: #fff; flex: none; position: relative; text-transform: uppercase; }
.file-ext.pdf { background: linear-gradient(160deg, #f43f5e, #be185d); }
.file-ext.doc, .file-ext.docx { background: linear-gradient(160deg, #3b82f6, #1d4ed8); }
.file-ext.ppt, .file-ext.pptx { background: linear-gradient(160deg, #fb923c, #c2410c); }
.file-ext.img { background: linear-gradient(160deg, #22d3ee, #0e7490); }
.file-ext.other { background: linear-gradient(160deg, #8b5cf6, #5b21b6); }
.best { position: absolute; top: -1px; right: 16px; padding: 3px 10px 4px; border-radius: 0 0 9px 9px; background: var(--grad); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.like { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--border-strong); background: transparent; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: .15s; }
.like svg { width: 14px; height: 14px; }
.like:hover { border-color: var(--pink-l); color: var(--pink-l); }
.like.on { background: rgba(236, 72, 153, .16); border-color: rgba(236, 72, 153, .5); color: var(--pink-l); }
.like.on svg { fill: currentColor; }

.dropzone { margin-top: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); transition: .2s; cursor: pointer; }
.dropzone.over, .dropzone:hover { border-color: var(--pink-l); background: rgba(236, 72, 153, .06); color: var(--text); }
.dropzone svg { width: 22px; height: 22px; display: block; margin: 0 auto 6px; color: var(--pink-l); }
.upload-item { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; text-align: left; }
.progress { height: 5px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.progress > i { display: block; height: 100%; background: var(--grad); width: 0; transition: width .2s; }

/* widok notatki */
.note-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.note-body { padding: 34px 40px; min-height: 300px; }
.versions { padding: 14px; position: sticky; top: 10px; }
.versions h5 { margin: 4px 6px 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.ver { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.ver:hover { background: rgba(139, 92, 246, .1); }
.ver.active { background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .25); }
.ver .vt { flex: 1; min-width: 0; }
.ver .vt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ver .vt span { font-size: 11.5px; color: var(--faint); }
.viewer { width: 100%; height: 78vh; border: 0; border-radius: 12px; background: #fff; }
.viewer-wrap { padding: 10px; }
.img-viewer { max-width: 100%; border-radius: 12px; display: block; margin: 0 auto; }

/* typografia notatek */
.prose { line-height: 1.75; font-size: 15.5px; color: #ddd8f5; word-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--display); color: var(--text); letter-spacing: -.02em; line-height: 1.25; margin: 1.6em 0 .6em; }
.prose h1 { font-size: 1.9em; }
.prose h2 { font-size: 1.45em; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.18em; }
.prose p { margin: .7em 0; }
.prose strong { color: #fff; }
.prose em { color: var(--pink-l); }
.prose a { border-bottom: 1px solid rgba(167, 139, 250, .4); }
.prose a.wikilink { background: rgba(139, 92, 246, .14); border: 0; padding: 1px 6px; border-radius: 6px; }
.prose a.wikilink.missing { color: var(--faint); background: rgba(255, 255, 255, .04); text-decoration: line-through; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--violet-l); }
.prose blockquote { margin: 1em 0; padding: .6em 1.1em; border-left: 3px solid; border-image: var(--grad) 1; background: rgba(139, 92, 246, .07); border-radius: 0 10px 10px 0; color: var(--muted); }
.prose code { font-family: var(--mono); font-size: .86em; padding: .15em .4em; border-radius: 6px; background: rgba(167, 139, 250, .14); color: var(--pink-l); }
.prose pre { background: rgba(8, 7, 15, .75); border: 1px solid var(--border); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: #d6d0f5; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .92em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border-strong); padding: 8px 12px; text-align: left; }
.prose th { background: rgba(139, 92, 246, .12); }
.prose hr { border: 0; height: 1px; background: var(--grad); opacity: .4; margin: 2em 0; }
.prose img { max-width: 100%; border-radius: 10px; }
.prose input[type=checkbox] { accent-color: var(--pink); }
.prose mark { background: rgba(236, 72, 153, .28); color: #fff; padding: 0 3px; border-radius: 3px; }

/* edytor */
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: 70vh; overflow: hidden; }
.editor.single { grid-template-columns: 1fr; }
.editor-pane { display: flex; flex-direction: column; min-height: 0; }
.editor-pane + .editor-pane { border-left: 1px solid var(--border); }
.editor-toolbar { display: flex; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; }
.tb { height: 30px; min-width: 30px; padding: 0 8px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.tb:hover { background: rgba(167, 139, 250, .15); color: #fff; }
.tb svg { width: 15px; height: 15px; }
.tb-sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
.editor textarea { flex: 1; width: 100%; border: 0; outline: none; resize: none; background: transparent; padding: 22px 24px; font-family: var(--mono); font-size: 14px; line-height: 1.75; min-height: 60vh; color: #e4dffa; }
.editor .preview-pane { padding: 22px 28px; overflow-y: auto; max-height: 75vh; }
.title-input { width: 100%; border: 0; outline: none; background: transparent; font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; padding: 4px 0; margin-bottom: 14px; }
.title-input::placeholder { color: var(--faint); }

/* ---------- menu kontekstowe ---------- */
.menu { position: fixed; z-index: 90; min-width: 210px; padding: 6px; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); animation: pop .14s ease both; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13.5px; color: var(--text); }
.menu button:hover { background: rgba(139, 92, 246, .16); }
.menu button svg { width: 15px; height: 15px; color: var(--muted); }
.menu button.danger { color: var(--red); }
.menu button.danger svg { color: var(--red); }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 5px 4px; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(4, 3, 10, .7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .18s ease both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow), 0 0 80px -20px rgba(139, 92, 246, .5); animation: pop .2s ease both; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.modal-head .mi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); flex: none; }
.modal-head .mi svg { width: 18px; height: 18px; }
.modal-head h3 { margin: 0; font-family: var(--display); font-size: 19px; letter-spacing: -.02em; flex: 1; }
.modal-body { padding: 14px 22px 8px; }
.modal-body > p { color: var(--muted); margin-top: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 20px; }
.type-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.type-opt { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--border-strong); cursor: pointer; transition: .15s; background: rgba(8, 7, 15, .4); }
.type-opt:hover { border-color: var(--violet-l); }
.type-opt.on { border-color: transparent; box-shadow: 0 0 0 1.5px var(--violet-l), 0 6px 20px -8px rgba(139, 92, 246, .6); background: rgba(139, 92, 246, .1); }
.type-opt svg { width: 18px; height: 18px; flex: none; }
.type-opt b { display: block; font-size: 13.5px; }
.type-opt span { font-size: 11.5px; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--border); margin-bottom: 8px; background: rgba(8, 7, 15, .35); }
.check-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--violet); }
.check-row .input { height: 32px; width: 70px; padding: 0 8px; text-align: center; }
.check-row .lbl { flex: 1; }
.exam-edit { display: grid; grid-template-columns: 1.4fr 1fr .7fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.exam-edit .input, .link-edit .input { height: 36px; padding: 0 10px; font-size: 13px; }
.link-edit { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 6px; margin-bottom: 6px; }
.colors { display: flex; gap: 8px; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: .15s; }
.color-dot.on { border-color: #fff; transform: scale(1.12); }

/* ---------- toast ---------- */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 13px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 13.5px; animation: pop .2s ease both; max-width: 380px; }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.ok svg { color: var(--green); }
.toast.err svg { color: var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }

.mobile-only { display: none !important; }

/* ---------- responsywność ---------- */
@media (max-width: 1000px) {
  .two-col, .info-grid, .note-layout { grid-template-columns: 1fr; }
  .versions { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .editor { grid-template-columns: 1fr; }
  .editor .preview-pane { display: none; }
  .editor.show-preview .preview-pane { display: block; }
  .editor.show-preview .write-pane { display: none; }
  .editor-pane + .editor-pane { border-left: 0; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 62px; bottom: 0; left: 0; width: 300px; max-width: 86vw; z-index: 30; transform: translateX(-100%); transition: transform .25s ease; background: rgba(10, 9, 19, .96); }
  .shell.side-open .sidebar { transform: none; box-shadow: 30px 0 60px rgba(0, 0, 0, .6); }
  .mobile-only { display: inline-flex !important; }
  .search kbd, .group-badge span, .me span { display: none; }
  .page { padding: 20px 16px 70px; }
  .auth-grid, .features { grid-template-columns: 1fr; }
  .note-body { padding: 22px 18px; }
  .exam-edit { grid-template-columns: 1fr 1fr; }
  .page-title h1 { font-size: 24px; }
}

/* ---------- dodatki: mapa, błędy formularzy ---------- */
.page.no-anim { animation: none; }
.form-err { margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .3); color: var(--red); font-size: 13px; }
.map li { padding-left: 10px; padding-right: 10px; }
.m-node > span:first-child:not(:last-child) { display: grid; place-items: center; }
.m-node > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.m-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; position: relative; }
.m-stack::before { content: ''; position: absolute; top: -16px; left: 50%; height: 16px; border-left: 1.5px dashed rgba(167, 139, 250, .35); }
.m-sub { display: block; width: 210px; padding: 9px 12px; border-radius: 11px; background: rgba(8, 7, 15, .55); border: 1px solid var(--border); border-left: 3px solid var(--c, var(--violet)); color: var(--text); transition: .18s; }
.m-sub:hover { color: var(--text); box-shadow: var(--glow); transform: translateX(2px); }
.m-sub-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; }
.m-sub-t > span:first-child { display: grid; place-items: center; flex: none; }
.m-sub-t > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.m-sub-t svg { width: 14px; height: 14px; }
.m-sub .cnt { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.m-secs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.m-chip { font-size: 10.5px; padding: 2px 8px; border-radius: 99px; background: rgba(167, 139, 250, .1); color: var(--muted); border: 1px solid rgba(167, 139, 250, .14); }
.m-chip i { font-style: normal; color: var(--violet-l); font-family: var(--mono); margin-left: 2px; }
.code-box svg { width: 16px; height: 16px; color: var(--pink-l); flex: none; }
.code-box .btn { font-family: var(--font); }
.m-node.root { max-width: 360px; }
.ver .page-ico svg { width: 15px; height: 15px; }
@media (max-width: 820px) {
  .me span { display: inline; }
  .me #me-name { display: none; }
  .me { padding: 3px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .group-badge b { font-size: 13.5px; max-width: 34vw; }
  .search { min-width: 0; }
  .search .input { padding-left: 34px; padding-right: 8px; }
}

/* ============ konta, Market, strony prawne ============ */
.landing.wide { align-items: stretch; }
.landing.wide > * { width: 100%; max-width: 1120px; margin-left: auto; margin-right: auto; }
.topnav { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 1120px; padding: 4px 0 6px; flex-wrap: wrap; }
.landing > .topnav + .hero { margin-top: 5vh; }
.topnav-links { display: flex; gap: 4px; margin-left: 10px; }
.topnav-links a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.topnav-links a svg { width: 16px; height: 16px; }
.topnav-links a:hover { color: var(--text); background: rgba(167, 139, 250, .08); }
.topnav-links a.on { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .25); }
.topnav .me { text-decoration: none; color: var(--text); }
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); width: 100%; max-width: 1120px; color: var(--faint); font-size: 12.5px; }
.site-foot a { color: var(--muted); }
.features { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); max-width: 1120px; }
a.feature, a.recent-item { color: var(--text); }
a.feature:hover { box-shadow: var(--glow); }
.recent { max-width: 1120px; }
.recent-item .av svg { width: 15px; height: 15px; }
.perks { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.perks li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.perks svg { width: 17px; height: 17px; color: var(--pink-l); flex: none; margin-top: 1px; }
.auth-card .btn.ghost { margin-top: 8px; }
.clause { display: flex; gap: 12px; padding: 12px 14px; margin: 4px 0 14px; border-radius: 12px; background: rgba(96, 165, 250, .07); border: 1px solid rgba(96, 165, 250, .2); font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.clause > svg { width: 18px; height: 18px; color: var(--blue-l); flex: none; margin-top: 2px; }
.clause b { color: var(--text); }
.check-row .lbl a { text-decoration: underline; }
.req { color: var(--pink-l); }
.danger-zone { margin-top: 18px; padding: 14px; border-radius: 12px; border: 1px solid rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .05); }
.danger-zone p { margin: 4px 0 10px; }
.account .two-col { align-items: start; }
.account .exam .btn { flex: none; }
.legal { padding: 36px 44px; margin-top: 24px; }
.legal .meta { color: var(--faint); font-size: 13px; margin-top: -6px; }
.legal table { display: table; }
.legal td:first-child { width: 30%; font-weight: 600; color: var(--text); }
.market-hero { margin-top: 18px; }
.market-tools { margin-top: 18px; position: relative; }
.market-tools .search { max-width: none; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; position: relative; }
.chips .chip { cursor: pointer; height: 28px; }
.chips .chip i { font-style: normal; font-family: var(--mono); opacity: .7; }
.m-subj { max-width: 75%; overflow: hidden; }
.m-subj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-note { margin-top: 22px; }
.note-card .nh { gap: 10px; }
@media (max-width: 820px) {
  .hide-mobile { display: none !important; }
  .topnav-links span { display: none; }
  .topnav .me span { display: none; }
  .legal { padding: 22px 18px; }
  .legal td:first-child { width: auto; }
}
@media (max-width: 820px) {
  .market-tools .search { flex: 1 1 100%; }
  .topnav { gap: 8px; }
  .topnav-links { margin-left: 0; }
}
.rules-box { display: flex; gap: 12px; padding: 14px 16px; margin: 6px 0 12px; border-radius: 12px; background: rgba(236, 72, 153, .07); border: 1px solid rgba(236, 72, 153, .25); font-size: 13px; line-height: 1.6; color: var(--muted); }
.rules-box > svg { width: 18px; height: 18px; color: var(--pink-l); flex: none; margin-top: 2px; }
.rules-box b { color: var(--text); }
.rules-box ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.rules-box a { text-decoration: underline; }

/* ============ Synapse: pasek kanałów (jak Discord), grupy, członkowie ============ */
.frame { display: flex; height: 100%; }
.frame-body { flex: 1; min-width: 0; height: 100%; position: relative; }
.frame-body > .landing { height: 100%; }
.frame-body > .shell { height: 100%; }
.rail { width: 72px; flex: none; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; background: rgba(6, 5, 12, .85); border-right: 1px solid var(--border); z-index: 35; }
.rail-groups { display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; overflow-x: hidden; flex: 1; width: 100%; padding: 2px 0; scrollbar-width: none; }
.rail-groups::-webkit-scrollbar { display: none; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: var(--border-strong); flex: none; }
.rail-item { position: relative; display: grid; place-items: center; width: 72px; flex: none; border: 0; background: none; cursor: pointer; padding: 0; color: var(--text); }
.rail-item::before { content: ''; position: absolute; left: 0; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: #fff; transform: translateY(-50%); transition: height .18s; }
.rail-item:hover::before { height: 18px; }
.rail-item.on::before { height: 36px; background: var(--grad); }
.rail-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; color: #fff; background: var(--surface-3); transition: border-radius .2s, transform .15s, box-shadow .2s; }
.rail-ico svg { width: 21px; height: 21px; }
.rail-item:hover .rail-ico, .rail-item.on .rail-ico { border-radius: 15px; }
.rail-item.on .rail-ico { box-shadow: 0 0 0 2px rgba(255, 255, 255, .12), 0 8px 20px -6px rgba(139, 92, 246, .7); }
.rail-ico.logo { background: var(--grad); }
.rail-ico.my { background: linear-gradient(135deg, #22d3ee, #8b5cf6); }
.rail-ico.add { background: transparent; border: 1.5px dashed var(--border-strong); color: var(--green); }
.rail-item:hover .rail-ico.add { background: var(--green); color: #08070f; border-color: transparent; }
.rail-ico.lang { font-size: 12px; letter-spacing: .04em; background: transparent; border: 1px solid var(--border-strong); color: var(--muted); }
.rail-item .avatar { width: 44px !important; height: 44px !important; transition: border-radius .2s; }
.rail-item:hover .avatar, .rail-item.on .avatar { border-radius: 15px; }
.rail-badge { position: absolute; right: 10px; bottom: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 3px solid #08070f; }
.rail-item.pending .rail-ico { opacity: .45; filter: grayscale(.6); }
.rail-clock { position: absolute; right: 12px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--amber); color: #08070f; display: grid; place-items: center; border: 3px solid #08070f; }
.rail-clock svg { width: 11px; height: 11px; }
.frame .shell { grid-template-columns: 280px 1fr; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.eyebrow { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.eyebrow a { color: var(--violet-l); }
.page-ico.mini { width: 30px; height: 36px; border-radius: 9px; }
.page-ico.mini svg { width: 15px; height: 15px; }
.col-stack { display: flex; flex-direction: column; gap: 16px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-mark { background: rgba(236, 72, 153, .35); padding: 0 3px; border-radius: 3px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.lang-btn svg { width: 15px; height: 15px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 18px; }
.group-card { display: flex; align-items: center; gap: 14px; padding: 16px; color: var(--text); transition: .2s; }
.group-card:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--glow); border-color: transparent; }
.group-card h3 { margin: 0; font-family: var(--display); font-size: 16px; }
.group-ico { width: 48px; height: 48px; border-radius: 15px; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: #fff; background: var(--surface-3); }
.group-ico.sm { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.group-ico.lg { width: 72px; height: 72px; border-radius: 22px; font-size: 24px; margin: 0 auto 12px; box-shadow: 0 12px 30px -10px rgba(139, 92, 246, .7); }
.member-list { padding: 6px; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.member + .member { border-top: 1px solid var(--border); }
.member b { font-size: 14px; }
.invite-box { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.invite-box > svg { width: 22px; height: 22px; color: var(--pink-l); flex: none; }
.invite-box code { font-family: var(--mono); font-size: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(8, 7, 15, .6); border: 1px solid var(--border); max-width: 320px; }
.join-card { max-width: 480px; margin: 8vh auto 0; text-align: center; padding: 30px; }
.join-card h3 { font-family: var(--display); font-size: 22px; margin: 0 0 4px; }
.join-card .chip { margin: 10px 0; }
.shell .topbar .me span { max-width: 140px; }
@media (max-width: 820px) {
  .rail { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .25s ease; }
  .frame:has(.shell.side-open) .rail { transform: none; }
  .frame .shell.side-open .sidebar { left: 72px; }
  .frame .shell { grid-template-columns: 1fr; }
  .frame:not(:has(.shell)) .rail { display: none; }
  .invite-box { flex-wrap: wrap; }
  .invite-box code { max-width: 100%; }
}
.me .avatar { display: grid !important; }
@media (max-width: 820px) {
  .topbar .me > span:not(.avatar), .topnav .me > span:not(.avatar) { display: none !important; }
  .frame .shell .topbar { padding-left: 8px; }
}
