:root {
  --bg: #090713;
  --bg-deep: #05040a;
  --panel: rgba(20, 17, 35, 0.78);
  --panel-solid: #151126;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --text: #f8f6ff;
  --muted: #a9a2bd;
  --faint: #716b83;
  --line: rgba(255, 255, 255, 0.105);
  --line-bright: rgba(255, 255, 255, 0.2);
  --violet: #9d73ff;
  --violet-bright: #ba9aff;
  --pink: #ff4fd8;
  --cyan: #29f4d3;
  --danger: #ff607f;
  --success: #49e6a2;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --body-top: #0b0815;
  --body-glow: rgba(114, 64, 220, 0.3);
  --topbar-bg: rgba(8, 6, 15, 0.74);
  --nav-bg: rgba(12, 9, 22, 0.92);
  --accent-soft: #e5d8ff;
  --hero-bg: linear-gradient(128deg, rgba(35,21,67,.88), rgba(16,12,29,.8) 55%, rgba(14,35,39,.5));
  --grid-size: 72px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

html[data-theme="acid"] {
  --bg: #06110d;
  --bg-deep: #020805;
  --panel: rgba(8, 24, 17, .8);
  --panel-solid: #0b2017;
  --text: #f4ffe9;
  --muted: #a7c6ac;
  --faint: #648272;
  --line: rgba(190, 255, 118, .14);
  --line-bright: rgba(190, 255, 118, .27);
  --violet: #9dff4f;
  --violet-bright: #c8ff78;
  --pink: #ffe747;
  --cyan: #47ffc2;
  --body-top: #07160f;
  --body-glow: rgba(121, 255, 69, .24);
  --topbar-bg: rgba(2, 12, 7, .78);
  --nav-bg: rgba(3, 18, 11, .94);
  --accent-soft: #efffa7;
  --hero-bg: linear-gradient(128deg, rgba(18,55,27,.94), rgba(5,23,14,.9) 58%, rgba(46,48,9,.62));
  --grid-size: 44px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 18px;
}

html[data-theme="ocean"] {
  --bg: #06111f;
  --bg-deep: #020711;
  --panel: rgba(8, 23, 43, .8);
  --panel-solid: #0b1d35;
  --text: #f4fbff;
  --muted: #9eb7cc;
  --faint: #60778d;
  --line: rgba(105, 205, 255, .14);
  --line-bright: rgba(105, 205, 255, .26);
  --violet: #458cff;
  --violet-bright: #75b6ff;
  --pink: #49d9ff;
  --cyan: #68ffe1;
  --body-top: #071a2e;
  --body-glow: rgba(46, 135, 255, .28);
  --topbar-bg: rgba(3, 14, 29, .78);
  --nav-bg: rgba(4, 19, 37, .94);
  --accent-soft: #cfedff;
  --hero-bg: linear-gradient(128deg, rgba(16,52,99,.92), rgba(5,22,43,.88) 56%, rgba(7,53,62,.65));
  --grid-size: 86px;
}

html[data-theme="sunset"] {
  --bg: #17080d;
  --bg-deep: #090306;
  --panel: rgba(38, 13, 23, .8);
  --panel-solid: #2b101d;
  --text: #fff7f4;
  --muted: #d0aaa9;
  --faint: #8a666d;
  --line: rgba(255, 146, 99, .15);
  --line-bright: rgba(255, 146, 99, .28);
  --violet: #ff664c;
  --violet-bright: #ff9a68;
  --pink: #ff4f9a;
  --cyan: #ffd15c;
  --body-top: #270c13;
  --body-glow: rgba(255, 63, 112, .27);
  --topbar-bg: rgba(23, 5, 11, .8);
  --nav-bg: rgba(34, 8, 17, .94);
  --accent-soft: #ffe0a8;
  --hero-bg: linear-gradient(128deg, rgba(91,25,31,.92), rgba(37,9,23,.9) 55%, rgba(82,35,9,.65));
  --grid-size: 60px;
  --radius-sm: 16px;
  --radius: 24px;
  --radius-lg: 38px;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -30%, var(--body-glow), transparent 50%),
    linear-gradient(180deg, var(--body-top) 0%, var(--bg-deep) 100%);
  line-height: 1.5;
  overflow-x: hidden;
}

body::selection { color: #090713; background: var(--cyan); }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient__orb {
  position: absolute;
  width: 32vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.16;
  animation: orbit 18s ease-in-out infinite alternate;
}

.ambient__orb--one { top: 12%; left: -15%; background: var(--violet); }
.ambient__orb--two { right: -14%; bottom: 4%; background: var(--pink); animation-delay: -8s; }

.ambient__grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  mask-image: linear-gradient(to bottom, transparent, black 20%, transparent 92%);
}

@keyframes orbit {
  to { transform: translate3d(12vw, 8vh, 0) scale(1.2); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 12px clamp(22px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(20px) saturate(130%);
}

.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; }
.brand__mark,
.login-brand > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  border: 1px solid rgba(157, 115, 255, 0.7);
  border-radius: 7px 12px 12px 7px;
  color: var(--violet-bright);
  background: linear-gradient(145deg, rgba(157, 115, 255, 0.2), rgba(255, 79, 216, 0.08));
  box-shadow: inset 3px 0 0 rgba(255,255,255,.08), 0 0 28px rgba(157,115,255,.2);
  font-weight: 900;
}
.brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.brand small { display: block; margin-top: 1px; color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .16em; }

.topbar__nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); }
.nav-link { padding: 9px 15px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 700; transition: .2s ease; }
.nav-link__icon, .nav-link__short { display: none; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.07); }
.nav-link--accent { color: #120b1f; background: linear-gradient(135deg, var(--violet-bright), var(--accent-soft)); }
.nav-link--accent:hover { color: #120b1f; background: #f3edff; box-shadow: 0 0 25px rgba(157,115,255,.3); }

.user-chip { justify-self: end; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 700; }
.user-chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px var(--success); }
.user-chip form { display: inline-flex; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; transition: .2s ease; }
.icon-button:hover { color: var(--text); border-color: var(--line-bright); background: rgba(255,255,255,.08); transform: translateY(-1px); }

.page-shell { width: min(1400px, calc(100% - 44px)); margin: 0 auto; padding: clamp(46px, 6vw, 84px) 0 80px; }

.eyebrow { margin: 0 0 12px; color: var(--violet-bright); font-size: 11px; font-weight: 900; letter-spacing: .19em; }
h1, h2, h3, p { text-wrap: pretty; }

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 30px;
  padding-bottom: 46px;
  border-bottom: 1px solid var(--line);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 32%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pink));
  box-shadow: 0 0 18px var(--pink);
}

.hero-panel h1,
.form-page__intro h1,
.admin-hero h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(44px, 6vw, 84px);
  line-height: .96;
  letter-spacing: -.06em;
}

.hero-panel h1 em,
.form-page__intro h1 em,
.admin-hero h1 em {
  color: transparent;
  background: linear-gradient(105deg, #fff 5%, var(--violet-bright) 43%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  font-style: normal;
  text-shadow: 0 0 40px rgba(157,115,255,.14);
}

.hero-panel__copy { max-width: 560px; margin: 22px 0 0; color: var(--muted); font-size: 17px; }
.hero-stats { display: flex; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.hero-stats div { min-width: 118px; padding: 22px; background: rgba(15,12,27,.88); }
.hero-stats strong { display: block; font-size: 29px; letter-spacing: -.04em; }
.hero-stats span { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 32px 0 22px; }
.search-form { display: flex; align-items: center; gap: 8px; width: min(600px, 100%); }
.search-form label { display: flex; align-items: center; flex: 1; gap: 10px; min-width: 0; padding: 4px 5px 4px 15px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); }
.search-form label:focus-within { border-color: rgba(157,115,255,.7); box-shadow: 0 0 0 3px rgba(157,115,255,.1), 0 0 28px rgba(157,115,255,.1); }
.search-form label span { color: var(--violet-bright); font-size: 24px; transform: rotate(-15deg); }
.search-form input { width: 100%; padding: 11px 2px; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-form input::placeholder { color: var(--faint); }
.search-form button { padding: 12px 17px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: rgba(255,255,255,.06); cursor: pointer; }
.view-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.view-tabs a { padding: 8px 13px; border-radius: 999px; color: var(--faint); font-size: 12px; font-weight: 800; }
.view-tabs a.is-active { color: var(--text); background: rgba(255,255,255,.09); }

.subject-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 24px; scrollbar-width: thin; }
.subject-pill { --subject: var(--violet); display: inline-flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.025); transition: .22s ease; }
.subject-pill:hover { color: var(--text); border-color: color-mix(in srgb, var(--subject), transparent 40%); transform: translateY(-2px); }
.subject-pill.is-active { color: var(--text); border-color: color-mix(in srgb, var(--subject), transparent 28%); background: color-mix(in srgb, var(--subject) 13%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--subject) 14%, transparent); }
.subject-pill > span { display: grid; place-items: center; min-width: 25px; height: 25px; border-radius: 7px; color: var(--subject); background: color-mix(in srgb, var(--subject) 12%, transparent); font-weight: 900; }
.subject-pill strong { font-size: 12px; white-space: nowrap; }
.subject-pill small { display: grid; place-items: center; min-width: 21px; height: 21px; border-radius: 99px; color: var(--faint); background: rgba(255,255,255,.06); font-size: 10px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 30px 0 25px; }
.section-heading h2 { margin: 0; font-size: clamp(23px, 3vw, 34px); letter-spacing: -.035em; }
.text-link { color: var(--muted); font-size: 13px; font-weight: 700; }
.text-link span { color: var(--cyan); }
.text-link:hover { color: var(--text); }

.book-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(18px, 2vw, 30px); perspective: 1200px; }
.book-card { --book: var(--violet); min-width: 0; }
.book-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: .72;
  overflow: hidden;
  padding: clamp(22px, 2.2vw, 32px) clamp(18px, 2vw, 28px) 22px;
  border: 1px solid color-mix(in srgb, var(--book), white 12%);
  border-radius: 8px 20px 20px 8px;
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--book) 30%, #171124) 0%, #0e0b18 58%, color-mix(in srgb, var(--book) 16%, #07060b) 100%);
  box-shadow:
    -8px 10px 20px rgba(0,0,0,.34),
    12px 24px 48px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.025) inset,
    0 0 35px color-mix(in srgb, var(--book) 8%, transparent);
  transform-origin: left center;
  transition: transform .42s cubic-bezier(.2,.8,.2,1), box-shadow .42s ease, border-color .3s;
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(120deg, transparent 0 18px, rgba(255,255,255,.025) 19px, transparent 20px),
    radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--book) 28%, transparent), transparent 35%);
  pointer-events: none;
}

.book-card:hover .book-cover { transform: rotateY(-7deg) translateY(-7px); border-color: var(--book); box-shadow: -13px 14px 24px rgba(0,0,0,.42), 18px 30px 56px rgba(0,0,0,.42), 0 0 40px color-mix(in srgb, var(--book) 17%, transparent); }
.book-cover__spine { position: absolute; inset: 0 auto 0 0; width: 9px; border-right: 1px solid rgba(255,255,255,.15); background: linear-gradient(90deg, #050309, color-mix(in srgb, var(--book) 35%, #120c1e), transparent); }
.book-cover__shine { position: absolute; inset: -60% -100%; background: linear-gradient(110deg, transparent 43%, rgba(255,255,255,.09) 50%, transparent 57%); transform: translateX(-30%); transition: transform .7s ease; }
.book-card:hover .book-cover__shine { transform: translateX(40%); }
.book-cover__code { position: relative; align-self: flex-start; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--book), transparent 35%); border-radius: 999px; color: var(--book); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.book-cover__emoji { position: relative; display: grid; place-items: center; width: clamp(48px, 5vw, 68px); aspect-ratio: 1; margin: auto 0 17px; border: 1px solid color-mix(in srgb, var(--book), transparent 42%); border-radius: 18px; color: var(--book); background: color-mix(in srgb, var(--book) 11%, transparent); box-shadow: 0 0 35px color-mix(in srgb, var(--book) 16%, transparent); font-size: clamp(24px, 3vw, 36px); font-style: normal; }
.book-cover strong { position: relative; display: -webkit-box; overflow: hidden; margin: 0 0 8px; font-size: clamp(17px, 1.8vw, 24px); line-height: 1.02; letter-spacing: -.045em; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.book-cover small { position: relative; display: -webkit-box; overflow: hidden; color: color-mix(in srgb, var(--book), white 45%); font-size: 11px; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-cover__footer { position: relative; margin-top: 20px; color: rgba(255,255,255,.32); font-size: 7px; font-weight: 900; letter-spacing: .16em; }
.book-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 5px 0; }
.book-meta div > span { display: block; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.book-meta div > small { display: block; margin-top: 2px; color: var(--faint); font-size: 10px; }
.favorite-button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--faint); background: transparent; cursor: pointer; transition: .2s; }
.favorite-button:hover, .favorite-button.is-active { color: #ffe27a; border-color: rgba(255,226,122,.35); background: rgba(255,226,122,.08); box-shadow: 0 0 16px rgba(255,226,122,.13); }

.book-card--add { display: grid; place-items: center; align-content: center; min-height: 300px; padding: 28px; border: 1px dashed rgba(157,115,255,.34); border-radius: 8px 20px 20px 8px; color: var(--muted); text-align: center; background: linear-gradient(145deg, rgba(157,115,255,.055), rgba(255,79,216,.025)); transition: .25s ease; }
.book-card--add:hover { color: var(--text); border-color: var(--violet); background: rgba(157,115,255,.09); transform: translateY(-5px); box-shadow: 0 20px 50px rgba(0,0,0,.25), 0 0 30px rgba(157,115,255,.1); }
.book-card--add > span { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px; border: 1px solid rgba(157,115,255,.35); border-radius: 50%; color: var(--violet-bright); font-size: 25px; }
.book-card--add strong { font-size: 15px; }
.book-card--add small { margin-top: 7px; color: var(--faint); font-size: 11px; }

.footer { display: flex; justify-content: space-between; width: min(1400px, calc(100% - 44px)); margin: 0 auto; padding: 24px 0 34px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.footer__status { display: flex; align-items: center; gap: 8px; }
.footer__status i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }

.toasts { position: fixed; top: 92px; right: 20px; z-index: 100; display: grid; gap: 10px; width: min(420px, calc(100% - 40px)); }
.toast { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line-bright); border-radius: 14px; background: rgba(18,15,30,.94); box-shadow: var(--shadow); backdrop-filter: blur(18px); animation: toast-in .4s cubic-bezier(.2,.8,.2,1); }
.toast > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #08120e; background: var(--success); font-weight: 900; }
.toast--error > span { background: var(--danger); }
.toast p { margin: 0; color: var(--muted); font-size: 13px; }
.toast button { border: 0; color: var(--faint); background: transparent; cursor: pointer; font-size: 19px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.login-shell { width: min(1040px, 100%); }
.login-card { display: grid; grid-template-columns: .92fr 1.08fr; min-height: 650px; overflow: hidden; border: 1px solid var(--line-bright); border-radius: 32px; background: rgba(15,12,26,.82); box-shadow: 0 40px 120px rgba(0,0,0,.55), 0 0 80px rgba(157,115,255,.07); backdrop-filter: blur(26px); }
.login-card__visual { position: relative; display: grid; place-items: center; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(circle at 50% 38%, rgba(157,115,255,.23), transparent 46%), linear-gradient(145deg, rgba(255,255,255,.025), transparent); perspective: 900px; }
.login-card__visual::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 45px 45px; mask-image: radial-gradient(circle, black, transparent 72%); }
.login-book { position: absolute; width: 245px; aspect-ratio: .73; border-radius: 8px 22px 22px 8px; }
.login-book--back { border: 1px solid rgba(41,244,211,.35); background: linear-gradient(150deg, #17342f, #090e11); transform: translate(40px, 20px) rotate(8deg); box-shadow: 0 30px 70px rgba(0,0,0,.5), 0 0 50px rgba(41,244,211,.08); }
.login-book--front { display: flex; flex-direction: column; padding: 33px 30px; border: 1px solid rgba(157,115,255,.65); background: linear-gradient(155deg, #392466 0%, #1a102e 52%, #0c0914 100%); box-shadow: -8px 8px 0 #08060d, 0 34px 70px rgba(0,0,0,.55), 0 0 65px rgba(157,115,255,.2); transform: translate(-20px, -4px) rotate(-5deg); animation: book-float 5s ease-in-out infinite; }
.login-book--front::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; border-right: 1px solid rgba(255,255,255,.2); background: #120b21; }
.login-book__eyebrow { color: var(--violet-bright); font-size: 7px; font-weight: 900; letter-spacing: .18em; }
.login-book strong { margin: auto 0 10px; font-size: 35px; letter-spacing: -.05em; }
.login-book small { color: #bdb3d5; font-size: 12px; }
.login-book i { width: 48px; height: 3px; margin-top: 20px; background: linear-gradient(90deg, var(--pink), var(--cyan)); box-shadow: 0 0 14px var(--pink); }
@keyframes book-float { 50% { transform: translate(-20px, -14px) rotate(-3deg); } }
.login-card__form { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 6vw, 78px); }
.login-brand { display: none; align-items: center; gap: 11px; margin-bottom: 38px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.login-card__form h1 { margin: 0; font-size: clamp(38px, 5vw, 58px); line-height: 1; letter-spacing: -.055em; }
.login-lead { max-width: 460px; margin: 18px 0 30px; color: var(--muted); font-size: 15px; }
.login-note { display: flex; align-items: center; gap: 9px; margin: 22px 0 0; color: var(--faint); font-size: 11px; }
.login-note span { color: var(--cyan); font-size: 8px; text-shadow: 0 0 10px var(--cyan); }

.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.field input, .field textarea, .field select, .password-field { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; color: var(--text); background: rgba(255,255,255,.035); transition: .2s ease; }
.field input, .field select { min-height: 47px; padding: 0 14px; }
.field textarea { resize: vertical; padding: 13px 14px; }
.field input:focus, .field textarea:focus, .field select:focus, .password-field:focus-within { border-color: rgba(157,115,255,.75); box-shadow: 0 0 0 3px rgba(157,115,255,.1), 0 0 25px rgba(157,115,255,.08); }
.field input::placeholder, .field textarea::placeholder { color: #625b74; }
.password-field { display: flex; align-items: center; }
.password-field input { border: 0; background: transparent; box-shadow: none !important; }
.password-field button { margin-right: 8px; border: 0; color: var(--violet-bright); background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 46px; padding: 0 18px; border-radius: 12px; cursor: pointer; font-size: 12px; font-weight: 900; letter-spacing: .02em; transition: .23s ease; }
.primary-button { border: 1px solid rgba(203,181,255,.9); color: #120b20; background: linear-gradient(135deg, var(--violet-bright), #e6dcff); box-shadow: 0 10px 28px rgba(111,75,199,.2); }
.primary-button:hover { background: #f0eaff; box-shadow: 0 12px 35px rgba(157,115,255,.32), 0 0 22px rgba(157,115,255,.16); transform: translateY(-2px); }
.secondary-button { border: 1px solid var(--line-bright); color: var(--text); background: rgba(255,255,255,.055); }
.secondary-button:hover { border-color: rgba(157,115,255,.55); background: rgba(157,115,255,.1); transform: translateY(-1px); }
.danger-button { min-height: 34px; padding: 0 11px; border: 1px solid rgba(255,96,127,.22); color: #ff8ba1; background: rgba(255,96,127,.06); font-size: 10px; }
.danger-button:hover { border-color: rgba(255,96,127,.5); background: rgba(255,96,127,.13); }
.primary-button--wide, .secondary-button--wide { width: 100%; }

.back-row { display: flex; align-items: center; justify-content: space-between; margin: -24px 0 34px; color: var(--faint); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.back-row a:hover { color: var(--text); }
.form-page { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(520px, 1.25fr); gap: clamp(40px, 8vw, 120px); align-items: start; }
.form-page__intro { position: sticky; top: 130px; }
.form-page__intro h1 { font-size: clamp(45px, 6vw, 76px); }
.form-page__intro > p:not(.eyebrow) { max-width: 500px; margin: 24px 0; color: var(--muted); }
.upload-hint { display: flex; align-items: center; gap: 14px; margin-top: 35px; padding: 15px; border: 1px solid rgba(41,244,211,.18); border-radius: 15px; background: rgba(41,244,211,.035); }
.upload-hint > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--cyan); background: rgba(41,244,211,.08); font-size: 22px; }
.upload-hint strong, .upload-hint small { display: block; }
.upload-hint strong { font-size: 12px; }
.upload-hint small { margin-top: 3px; color: var(--faint); font-size: 10px; }
.editor-card, .admin-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(20,17,35,.72); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.editor-card { padding: clamp(24px, 4vw, 44px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 21px 17px; }
.field--wide { grid-column: 1 / -1; }
.file-drop { position: relative; place-items: center; gap: 4px; min-height: 150px; padding: 25px; border: 1px dashed rgba(157,115,255,.35); border-radius: 15px; text-align: center; background: rgba(157,115,255,.035); cursor: pointer; transition: .2s; }
.file-drop:hover, .file-drop.is-dragging { border-color: var(--violet); background: rgba(157,115,255,.08); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop__icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 6px; border-radius: 50%; color: var(--violet-bright); background: rgba(157,115,255,.1); font-size: 22px; }
.file-drop strong { max-width: 100%; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-drop small { color: var(--faint); font-size: 10px; }
.editor-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 23px; border-top: 1px solid var(--line); }
.editor-card__footer p { margin: 0; color: var(--faint); font-size: 11px; }

.reader { display: grid; grid-template-columns: minmax(230px, 320px) minmax(0, 1fr); gap: clamp(35px, 6vw, 90px); align-items: start; }
.reader__cover { position: sticky; top: 118px; display: grid; gap: 12px; }
.book-cover--large { width: 100%; padding: 35px 31px 27px; }
.book-cover--large strong { font-size: clamp(27px, 3vw, 40px); }
.reader__page { min-width: 0; padding: clamp(28px, 5vw, 62px); border: 1px solid var(--line); border-radius: 7px 28px 28px 7px; color: #eae5f5; background: linear-gradient(90deg, rgba(255,255,255,.025), transparent 5%), rgba(23,20,36,.84); box-shadow: inset 5px 0 12px rgba(0,0,0,.17), var(--shadow); }
.reader__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--faint); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.reader__meta span:not(:last-child)::after { content: "·"; margin-left: 18px; color: var(--violet); }
.reader__page > h1 { margin: 22px 0 9px; font-size: clamp(35px, 5vw, 64px); line-height: .98; letter-spacing: -.055em; }
.reader__subtitle { margin: 0; color: color-mix(in srgb, var(--book), white 45%); font-size: 19px; }
.reader__description { max-width: 760px; margin: 22px 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0; }
.tags span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font-size: 10px; }
.note-paper { position: relative; margin: 35px 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--book), transparent 55%); border-radius: 3px 18px 18px 3px; background: #f1eddf; color: #201c28; box-shadow: 0 22px 50px rgba(0,0,0,.25), inset 7px 0 12px rgba(37,21,49,.08); }
.note-paper::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 30px, rgba(82,66,101,.095) 31px, transparent 32px); }
.note-paper__label { position: relative; z-index: 1; padding: 16px 24px; border-bottom: 1px solid rgba(32,28,40,.15); color: #6b416d; font-size: 9px; font-weight: 1000; letter-spacing: .16em; }
.note-paper__body { position: relative; z-index: 1; padding: 27px 30px 36px; font: 600 15px/2.08 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.file-section { margin-top: 46px; padding-top: 34px; border-top: 1px solid var(--line); }
.section-heading--compact { margin: 0 0 20px; }
.section-heading--compact h2 { overflow-wrap: anywhere; font-size: 20px; }
.section-heading--compact > span { color: var(--faint); font-size: 11px; }
.document-preview { width: 100%; height: min(76vh, 880px); border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.pdf-reader { overflow: visible; border: 1px solid var(--line-bright); border-radius: 18px; background: #0c0915; box-shadow: 0 24px 70px rgba(0,0,0,.32); }
.pdf-reader__toolbar { position: sticky; top: 78px; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 9px 11px; border-bottom: 1px solid var(--line); border-radius: 17px 17px 0 0; background: rgba(16,12,28,.94); box-shadow: 0 8px 28px rgba(0,0,0,.28); backdrop-filter: blur(18px); }
.pdf-reader__nav, .pdf-reader__zoom { display: flex; align-items: center; gap: 5px; }
.pdf-reader__toolbar button, .pdf-reader__toolbar > a { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255,255,255,.055); cursor: pointer; font-size: 11px; font-weight: 850; white-space: nowrap; }
.pdf-reader__toolbar button:hover, .pdf-reader__toolbar > a:hover { border-color: rgba(157,115,255,.55); background: rgba(157,115,255,.13); }
.pdf-reader__nav > span { min-width: 92px; color: var(--muted); text-align: center; font: 800 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.pdf-reader__toolbar > a { color: #100918; border-color: rgba(203,181,255,.8); background: linear-gradient(135deg, var(--violet-bright), #e6dcff); }
.pdf-reader__status { display: grid; place-items: center; min-height: 360px; padding: 36px; text-align: center; }
.pdf-reader__status[hidden] { display: none; }
.pdf-reader__status strong, .pdf-reader__status small { display: block; }
.pdf-reader__status strong { margin-top: 18px; font-size: 15px; }
.pdf-reader__status small { margin-top: 6px; color: var(--faint); font-size: 11px; }
.pdf-reader__status a { margin-top: 18px; padding: 11px 16px; border-radius: 10px; color: #100918; background: var(--violet-bright); font-size: 11px; font-weight: 900; }
.pdf-reader__status.is-error { color: var(--danger); }
.pdf-reader__spinner { width: 36px; height: 36px; border: 3px solid rgba(157,115,255,.16); border-top-color: var(--violet-bright); border-radius: 50%; animation: pdf-spin .8s linear infinite; }
@keyframes pdf-spin { to { transform: rotate(360deg); } }
.pdf-reader__viewport { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: var(--violet) rgba(255,255,255,.04); -webkit-overflow-scrolling: touch; }
.pdf-reader__pages { --pdf-zoom: 1; display: grid; gap: clamp(12px, 2.3vw, 24px); width: calc(100% * var(--pdf-zoom)); min-width: calc(100% * var(--pdf-zoom)); padding: clamp(12px, 2.4vw, 25px); background: radial-gradient(circle at 50% 0, rgba(157,115,255,.11), transparent 28%), #09070f; transition: width .18s ease; }
.pdf-reader__page { position: relative; width: min(100%, calc(980px * var(--pdf-zoom))); aspect-ratio: 612 / 792; overflow: hidden; margin: 0 auto; border-radius: 3px; background: #fff; box-shadow: 0 10px 34px rgba(0,0,0,.42); scroll-margin-top: 148px; }
.pdf-reader__page::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, #efedf3 20%, #fff 36%, #efedf3 52%); background-size: 200% 100%; animation: pdf-shimmer 1.2s linear infinite; }
@keyframes pdf-shimmer { to { background-position-x: -200%; } }
.pdf-reader__page canvas { position: relative; z-index: 1; display: block; max-width: none; opacity: 0; transition: opacity .16s ease; }
.pdf-reader__page.is-rendered canvas { opacity: 1; }
.pdf-reader__page.is-rendered::before { display: none; }
.pdf-reader__page.is-broken { display: grid; place-items: center; color: #a12a46; background: #fff3f5; }
.pdf-reader__page-number { position: absolute; right: 8px; bottom: 8px; z-index: 2; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; color: #eee9f8; background: rgba(14,10,24,.72); font: 800 9px ui-monospace, monospace; backdrop-filter: blur(8px); }
.image-preview { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 16px; box-shadow: var(--shadow); }
.file-fallback { display: flex; align-items: center; gap: 18px; margin: 0 0 16px; padding: 24px; border: 1px dashed var(--line-bright); border-radius: 15px; color: var(--muted); background: rgba(255,255,255,.03); }
.file-fallback > span { color: var(--violet-bright); font-size: 26px; }
.file-fallback p { margin: 0; }

.admin-hero { max-width: 900px; margin-bottom: 54px; }
.admin-hero h1 { font-size: clamp(43px, 6vw, 76px); }
.admin-hero > p:last-child { max-width: 630px; margin: 22px 0 0; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr); gap: 22px; align-items: start; }
.admin-card { padding: 26px; }
.admin-card--wide { min-width: 0; }
.admin-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; }
.admin-card__head h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.admin-card__head > span { display: grid; place-items: center; min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--violet-bright); font-size: 12px; font-weight: 900; }
.check-field { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; cursor: pointer; }
.check-field input { accent-color: var(--violet); }
.inline-fields { display: grid; grid-template-columns: 1fr .55fr .45fr; gap: 10px; }
.field--tiny input { padding: 6px; }
.table-list { display: grid; }
.table-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.table-row:last-child { border-bottom: 0; }
.avatar, .file-icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(157,115,255,.25); border-radius: 12px; color: var(--violet-bright); background: rgba(157,115,255,.07); font-weight: 900; }
.file-icon { font-size: 8px; letter-spacing: .08em; }
.table-row__main { flex: 1; min-width: 0; }
.table-row__main strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.table-row__main small { display: block; overflow: hidden; margin-top: 3px; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.role-badge, .status-badge { flex: 0 0 auto; padding: 4px 7px; border: 1px solid rgba(157,115,255,.25); border-radius: 99px; color: var(--violet-bright); background: rgba(157,115,255,.06); font: 800 8px ui-monospace, monospace; text-transform: uppercase; }
.status-badge { border-color: rgba(73,230,162,.2); color: var(--success); background: rgba(73,230,162,.05); }
.status-badge.is-off { border-color: rgba(255,96,127,.2); color: var(--danger); background: rgba(255,96,127,.05); }

.empty-state { display: grid; place-items: center; min-height: 380px; padding: 45px; border: 1px dashed var(--line-bright); border-radius: var(--radius-lg); text-align: center; background: rgba(255,255,255,.025); }
.empty-state > span { color: var(--violet-bright); font-size: 48px; text-shadow: 0 0 28px rgba(157,115,255,.4); }
.empty-state h3, .empty-state h1 { margin: 15px 0 7px; font-size: 30px; letter-spacing: -.04em; }
.empty-state p { margin: 0 0 23px; color: var(--muted); }
.error-state > span { font-size: 72px; font-weight: 1000; letter-spacing: -.08em; }

@media (max-width: 1180px) {
  .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar__nav { justify-self: center; }
}

@media (max-width: 920px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar__nav { position: fixed; right: 16px; bottom: 16px; left: 16px; justify-content: center; background: rgba(12,9,22,.92); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
  .user-chip > span:not(.user-chip__dot) { display: none; }
  .page-shell { padding-bottom: 120px; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-stats { width: fit-content; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .view-tabs { width: fit-content; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-page { grid-template-columns: 1fr; }
  .form-page__intro { position: static; }
  .reader { grid-template-columns: 220px minmax(0, 1fr); gap: 30px; }
  .reader__page { padding: 32px; }
  .admin-grid { grid-template-columns: 1fr; }
  .login-card { grid-template-columns: 1fr; }
  .login-card__visual { display: none; }
  .login-brand { display: flex; }
}

@media (max-width: 680px) {
  .page-shell, .footer { width: min(100% - 28px, 1400px); }
  .page-shell { padding-top: 38px; }
  .brand small { display: none; }
  .nav-link { padding: 9px 10px; font-size: 11px; }
  .hero-panel h1, .form-page__intro h1, .admin-hero h1 { font-size: 45px; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .hero-stats div { min-width: 0; padding: 16px 12px; }
  .hero-stats strong { font-size: 24px; }
  .hero-stats span { font-size: 8px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 12px; }
  .book-cover { padding: 21px 16px 18px; }
  .book-card--add { min-height: 250px; }
  .form-grid { grid-template-columns: 1fr; }
  .field:not(.field--tiny) { grid-column: 1 / -1; }
  .editor-card { padding: 20px; }
  .editor-card__footer { align-items: stretch; flex-direction: column; }
  .reader { grid-template-columns: 1fr; }
  .reader__cover { position: static; grid-template-columns: minmax(0, 230px) 1fr; align-items: end; }
  .reader__cover .book-cover { grid-row: span 2; }
  .reader__page { padding: 25px 19px; border-radius: 6px 20px 20px 6px; }
  .note-paper__body { padding: 22px 19px 30px; font-size: 13px; }
  .document-preview { height: 65vh; }
  .pdf-reader { margin-right: -19px; margin-left: -19px; border-right: 0; border-left: 0; border-radius: 0; }
  .pdf-reader__toolbar { top: 77px; display: grid; grid-template-columns: 1fr auto; border-radius: 0; }
  .pdf-reader__zoom { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .pdf-reader__toolbar > a { grid-column: 2; grid-row: 1; }
  .pdf-reader__nav { justify-content: start; }
  .pdf-reader__pages { gap: 10px; padding: 8px; }
  .pdf-reader__page { scroll-margin-top: 202px; }
  .footer { padding-bottom: 100px; }
  .footer > span:first-child { display: none; }
  .table-row { flex-wrap: wrap; }
  .role-badge, .status-badge { display: none; }
  .login-page { padding: 12px; }
  .login-card { min-height: calc(100vh - 24px); border-radius: 24px; }
  .login-card__form { padding: 28px; }
}

@media (max-width: 420px) {
  .book-grid { gap: 16px 9px; }
  .book-cover strong { font-size: 15px; }
  .book-cover__emoji { width: 45px; border-radius: 13px; font-size: 23px; }
  .book-meta div > span { max-width: 95px; }
  .reader__cover { grid-template-columns: minmax(0, 180px) 1fr; }
  .reader__cover .primary-button, .reader__cover .secondary-button { gap: 5px; padding: 0 8px; font-size: 9px; }
  .pdf-reader__toolbar { padding: 8px; }
  .pdf-reader__nav > span { min-width: 82px; }
  .pdf-reader__toolbar button, .pdf-reader__toolbar > a { min-height: 38px; padding: 0 9px; }
}

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

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* Bonch Hub social layer */
.nav-link.is-active { color: var(--text); background: rgba(255,255,255,.085); }
.nav-badge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 5px; padding: 0 4px; border-radius: 99px; color: #100817; background: var(--pink); font-size: 9px; box-shadow: 0 0 13px rgba(255,79,216,.45); }
.notification-button { position: relative; }
.notification-button > b { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid #090713; border-radius: 99px; color: #100817; background: var(--cyan); font-size: 8px; }

.hub-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; min-height: 320px; overflow: hidden; margin: -24px 0 38px; padding: clamp(32px, 5vw, 66px); border: 1px solid color-mix(in srgb, var(--violet) 25%, transparent); border-radius: 32px; background: var(--hero-bg); box-shadow: 0 30px 90px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.08); }
.hub-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 82% 20%, rgba(41,244,211,.16), transparent 30%), linear-gradient(115deg, transparent 58%, rgba(255,255,255,.03) 58.2%, transparent 58.5%); pointer-events: none; }
.hub-hero__copy { position: relative; z-index: 2; }
.live-label { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 10px; border: 1px solid rgba(41,244,211,.25); border-radius: 999px; color: var(--cyan); background: rgba(41,244,211,.055); font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.live-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: live-pulse 1.7s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .25; transform: scale(.7); } }
.hub-hero h1, .messages-intro h1 { margin: 0; font-size: clamp(48px, 6.5vw, 88px); line-height: .93; letter-spacing: -.065em; }
.hub-hero h1 em, .messages-intro h1 em { color: transparent; background: linear-gradient(100deg, #fff, var(--violet-bright) 45%, var(--cyan)); -webkit-background-clip: text; background-clip: text; font-style: normal; }
.hub-hero__copy > p { max-width: 630px; margin: 22px 0 0; color: #b9b1ca; font-size: 17px; }
.hub-hero__stats { position: relative; z-index: 2; display: flex; gap: 1px; overflow: hidden; margin-right: 140px; border: 1px solid var(--line); border-radius: 17px; background: var(--line); }
.hub-hero__stats div { min-width: 94px; padding: 17px; background: rgba(10,8,18,.68); }
.hub-hero__stats strong, .hub-hero__stats span { display: block; }
.hub-hero__stats strong { font-size: 27px; letter-spacing: -.04em; }
.hub-hero__stats span { color: var(--faint); font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.signal-art { position: absolute; right: 35px; top: 38px; width: 150px; height: 150px; }
.signal-art span { position: absolute; inset: 50%; border: 1px solid rgba(41,244,211,.22); border-radius: 50%; animation: signal 3s ease-out infinite; }
.signal-art span:nth-child(2) { animation-delay: 1s; }.signal-art span:nth-child(3) { animation-delay: 2s; }
.signal-art b { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(41,244,211,.5); border-radius: 50%; color: var(--cyan); background: #0b1118; box-shadow: 0 0 30px rgba(41,244,211,.23); transform: translate(-50%,-50%); }
@keyframes signal { from { inset: 50%; opacity: .9; } to { inset: 0; opacity: 0; } }

.hub-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .75fr); gap: 28px; align-items: start; }
.feed-column { min-width: 0; }
.composer-card { display: grid; grid-template-columns: 45px minmax(0,1fr); gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 18px 55px rgba(0,0,0,.22); backdrop-filter: blur(17px); }
.avatar--neon { color: var(--cyan); border-color: rgba(41,244,211,.38); background: rgba(41,244,211,.07); box-shadow: 0 0 22px rgba(41,244,211,.1); }
.avatar--admin { color: #140b20; border: 0; background: linear-gradient(135deg, var(--violet-bright), var(--pink)); }
.composer-card form { min-width: 0; }
.composer-card textarea { width: 100%; min-height: 75px; padding: 8px 4px; resize: vertical; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 17px; line-height: 1.55; }
.composer-card textarea::placeholder { color: #6f677e; }
.composer-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid var(--line); }
.post-kinds { display: flex; gap: 5px; }
.post-kinds label { cursor: pointer; }
.post-kinds input { position: absolute; opacity: 0; }
.post-kinds span { display: inline-block; padding: 7px 10px; border: 1px solid transparent; border-radius: 999px; color: var(--faint); font-size: 10px; font-weight: 800; transition: .2s; }
.post-kinds input:checked + span { color: var(--violet-bright); border-color: rgba(157,115,255,.25); background: rgba(157,115,255,.08); }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.attach-button { cursor: pointer; }
.attach-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.attach-button span { display: inline-flex; min-height: 39px; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 10px; font-weight: 800; }
.attach-button:hover span { color: var(--cyan); border-color: rgba(41,244,211,.3); }
.composer-actions .primary-button { min-height: 39px; }
.feed-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 38px 0 18px; }
.feed-heading h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.social-feed { display: grid; gap: 17px; }
.post-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 18px 55px rgba(0,0,0,.18); scroll-margin-top: 105px; }
.post-card--important { border-color: rgba(255,184,77,.3); background: linear-gradient(135deg, rgba(255,184,77,.07), rgba(20,17,34,.82) 42%); }
.post-card--meme { border-color: rgba(255,79,216,.24); }
.post-card__head { display: flex; align-items: center; gap: 11px; padding: 19px 20px 0; }
.post-card__head > div:nth-child(2) { flex: 1; min-width: 0; }
.post-card__head strong, .post-card__head small { display: block; }
.post-card__head strong { font-size: 13px; }
.post-card__head small { margin-top: 2px; color: var(--faint); font-size: 10px; }
.post-kind { padding: 4px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font: 900 7px ui-monospace, monospace; letter-spacing: .12em; }
.post-card--meme .post-kind { color: var(--pink); border-color: rgba(255,79,216,.24); }.post-card--important .post-kind { color: #ffca78; border-color: rgba(255,184,77,.26); }
.post-menu { width: 28px; height: 28px; padding: 0; border: 0; color: var(--faint); background: transparent; cursor: pointer; font-size: 20px; }
.post-card__text { padding: 18px 20px 20px 76px; color: #ded8ea; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-media { display: block; overflow: hidden; margin: 4px 20px 18px 76px; border: 1px solid var(--line); border-radius: 17px; background: #08070d; }
.post-media img { display: block; width: 100%; max-height: 610px; object-fit: contain; }
.text-meme { position: relative; display: grid; place-items: center; min-height: 260px; overflow: hidden; margin: 4px 20px 18px 76px; border: 1px solid rgba(255,79,216,.18); border-radius: 17px; background: radial-gradient(circle, rgba(255,79,216,.18), transparent 55%), repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 1px, transparent 1px 16px), #0c0812; }
.text-meme span, .text-meme small { position: absolute; color: rgba(255,255,255,.35); font: 900 9px ui-monospace, monospace; letter-spacing: .28em; }.text-meme span { top: 20px; }.text-meme small { bottom: 20px; }.text-meme b { font-size: 82px; filter: drop-shadow(0 0 28px rgba(255,79,216,.35)); transform: rotate(-4deg); }
.post-card__actions { display: flex; gap: 7px; margin: 0 20px 0 76px; padding: 12px 0; border-top: 1px solid var(--line); }
.post-card__actions form { display: inline-flex; }
.reaction-button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 9px; border: 1px solid transparent; border-radius: 99px; color: var(--faint); background: transparent; cursor: pointer; font-size: 11px; }
.reaction-button:hover { color: var(--text); background: rgba(255,255,255,.05); }.reaction-button.is-active { color: var(--pink); background: rgba(255,79,216,.07); }.reaction-button span { font-size: 9px; font-weight: 800; }
.comments { padding: 4px 20px 17px 76px; }
.comment { display: flex; gap: 9px; margin: 9px 0; }
.mini-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(157,115,255,.25); border-radius: 8px; color: var(--violet-bright); background: rgba(157,115,255,.06); font-size: 9px; font-weight: 900; }
.comment p { margin: 0; padding: 8px 10px; border-radius: 4px 12px 12px 12px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 11px; }.comment p strong { color: var(--text); }.comment p small { display: block; margin-top: 3px; color: var(--faint); font-size: 8px; }
.comment-form { display: grid; grid-template-columns: 27px 1fr 30px; gap: 8px; margin-top: 12px; }
.comment-form input { min-width: 0; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; outline: 0; color: var(--text); background: rgba(255,255,255,.03); font-size: 10px; }.comment-form input:focus { border-color: rgba(157,115,255,.5); }.comment-form button { border: 0; border-radius: 50%; color: #110a1b; background: var(--violet-bright); cursor: pointer; }

.hub-sidebar { position: sticky; top: 99px; display: grid; gap: 17px; }
.widget { overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: var(--panel); box-shadow: 0 18px 50px rgba(0,0,0,.18); backdrop-filter: blur(17px); }
.widget__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }.widget__head h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }.widget__head > span { color: var(--violet-bright); }.widget__head > a { color: var(--violet-bright); font-size: 10px; font-weight: 800; }
.weather-widget { background: radial-gradient(circle at 100% 0, rgba(41,244,211,.1), transparent 34%), rgba(20,17,34,.8); }
.weather-now { display: flex; align-items: center; gap: 14px; padding: 20px; }.weather-now > span { font-size: 50px; filter: drop-shadow(0 0 20px rgba(41,244,211,.16)); }.weather-now strong, .weather-now small { display: block; }.weather-now strong { font-size: 44px; line-height: 1; letter-spacing: -.06em; }.weather-now small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.weather-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 13px 13px; }.weather-day { display: grid; place-items: center; gap: 3px; padding: 9px 2px; border-radius: 10px; }.weather-day.is-today { background: rgba(157,115,255,.1); }.weather-day span { color: var(--faint); font-size: 8px; font-weight: 800; }.weather-day i { font-style: normal; font-size: 17px; }.weather-day strong { font-size: 11px; }.weather-day small { color: var(--faint); font-size: 8px; }
.widget-note { margin: 0; padding: 12px 18px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8px; line-height: 1.5; }
.quick-links { display: grid; padding: 12px; }.quick-links a { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); transition: .2s; }.quick-links a:last-child { border-bottom: 0; }.quick-links a:hover { padding-left: 12px; border-radius: 12px; background: rgba(255,255,255,.04); }.quick-links a > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--cyan); background: rgba(41,244,211,.055); }.quick-links strong, .quick-links small { display: block; }.quick-links strong { font-size: 11px; }.quick-links small { color: var(--faint); font-size: 8px; }.quick-links b { color: var(--faint); font-size: 10px; }
.live-dot { padding: 4px 6px; border: 1px solid rgba(255,79,216,.24); border-radius: 99px; color: var(--pink) !important; font: 900 7px ui-monospace, monospace; letter-spacing: .1em; }
.news-list { display: grid; padding: 10px 17px 0; }.news-list a { position: relative; display: grid; grid-template-columns: 62px 1fr 14px; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }.news-list time { color: var(--faint); font: 800 8px ui-monospace, monospace; }.news-list strong { font-size: 10px; line-height: 1.45; }.news-list a > span { color: var(--violet-bright); font-size: 10px; }.news-list a:hover strong { color: var(--violet-bright); }.widget-link { display: block; padding: 14px 17px; color: var(--muted); font-size: 9px; font-weight: 800; }.widget-offline { margin: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--faint); font-size: 10px; }
.mini-shelf { display: grid; gap: 6px; padding: 13px; }.mini-shelf a { display: grid; grid-template-columns: 37px 1fr; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }.mini-shelf a:hover { background: rgba(255,255,255,.04); }.mini-shelf a > span { display: grid; place-items: center; width: 36px; height: 42px; border: 1px solid color-mix(in srgb, var(--book), transparent 45%); border-radius: 4px 9px 9px 4px; background: color-mix(in srgb, var(--book) 9%, transparent); }.mini-shelf strong, .mini-shelf small { display: block; }.mini-shelf strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.mini-shelf small { color: var(--faint); font-size: 8px; }

/* Messenger */
.messages-intro { margin-bottom: 38px; }.messages-intro h1 { font-size: clamp(43px, 6vw, 76px); }
.messenger { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 680px; overflow: hidden; border: 1px solid var(--line); border-radius: 27px; background: rgba(15,12,27,.78); box-shadow: var(--shadow); }
.messenger__contacts { border-right: 1px solid var(--line); background: rgba(255,255,255,.018); }.messenger__contacts > header { display: flex; align-items: center; justify-content: space-between; padding: 23px; border-bottom: 1px solid var(--line); }.messenger__contacts h2 { margin: 0; font-size: 19px; }.messenger__contacts header > span { color: var(--faint); font-size: 11px; }
.contact-list { display: grid; padding: 10px; }.contact { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px; border-radius: 14px; }.contact:hover, .contact.is-active { background: rgba(157,115,255,.075); }.contact.is-active { box-shadow: inset 2px 0 var(--violet); }.contact__copy { min-width: 0; }.contact__copy strong, .contact__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.contact__copy strong { font-size: 11px; }.contact__copy small { margin-top: 3px; color: var(--faint); font-size: 8px; }.contact > b { display: grid; place-items: center; min-width: 19px; height: 19px; border-radius: 99px; color: #0a0711; background: var(--pink); font-size: 8px; }.contacts-empty { padding: 25px; color: var(--faint); font-size: 11px; }
.messenger__chat { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; height: min(74vh, 760px); }.chat-head { display: flex; align-items: center; gap: 11px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.018); }.chat-head div { flex: 1; }.chat-head strong, .chat-head small { display: block; }.chat-head strong { font-size: 12px; }.chat-head small { color: var(--faint); font-size: 9px; }.chat-head i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px var(--success); }
.chat-stream { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 24px; scroll-behavior: smooth; }.bubble { align-self: flex-start; max-width: min(78%, 620px); padding: 11px 13px 8px; border: 1px solid var(--line); border-radius: 5px 17px 17px 17px; background: rgba(255,255,255,.045); }.bubble--mine { align-self: flex-end; border-color: rgba(157,115,255,.28); border-radius: 17px 5px 17px 17px; background: linear-gradient(135deg, rgba(157,115,255,.16), rgba(255,79,216,.07)); }.bubble p { margin: 0; color: #ded8ea; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }.bubble time { display: block; margin-top: 5px; color: var(--faint); font-size: 7px; text-align: right; }.chat-empty { display: grid; place-items: center; align-content: center; min-height: 260px; padding: 30px; color: var(--faint); text-align: center; }.chat-empty > span { color: var(--violet-bright); font-size: 35px; }.chat-empty h3 { margin: 9px 0 2px; color: var(--text); }.chat-empty p { margin: 0; font-size: 11px; }
.message-compose { display: grid; grid-template-columns: 1fr 43px; gap: 9px; padding: 14px; border-top: 1px solid var(--line); }.message-compose textarea { min-height: 43px; max-height: 130px; padding: 12px 15px; resize: none; border: 1px solid var(--line); border-radius: 15px; outline: 0; color: var(--text); background: rgba(255,255,255,.035); }.message-compose textarea:focus { border-color: rgba(157,115,255,.5); }.message-compose button { border: 0; border-radius: 14px; color: #110a1b; background: linear-gradient(135deg, var(--violet-bright), var(--pink)); cursor: pointer; font-size: 20px; }

/* Notifications */
.notifications-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 38px; }.notifications-head h1 { margin: 0; font-size: clamp(47px, 7vw, 88px); letter-spacing: -.065em; }.notifications-head p:last-child { margin: 12px 0 0; color: var(--muted); }.notification-list { display: grid; gap: 8px; max-width: 900px; }.notification-item { display: grid; grid-template-columns: 43px 1fr auto auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); }.notification-item.is-unread { border-color: rgba(157,115,255,.25); background: rgba(157,115,255,.06); }.notification-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 12px; color: var(--violet-bright); background: rgba(157,115,255,.08); }.notification-item strong, .notification-item small { display: block; }.notification-item strong { font-size: 12px; }.notification-item small { margin-top: 4px; color: var(--faint); font-size: 9px; }.notification-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 12px var(--pink); }.notification-item > b { color: var(--faint); }

/* File preview matrix */
.media-preview { display: block; width: 100%; max-height: 78vh; border: 1px solid var(--line); border-radius: 16px; background: #050408; }
.audio-preview { display: grid; grid-template-columns: 55px 1fr; align-items: center; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(135deg, rgba(157,115,255,.09), rgba(41,244,211,.04)); }.audio-preview > span { display: grid; place-items: center; width: 53px; height: 53px; border-radius: 50%; color: var(--cyan); background: rgba(41,244,211,.08); font-size: 24px; box-shadow: 0 0 22px rgba(41,244,211,.1); }.audio-preview audio { width: 100%; }.document-preview--text { height: min(64vh, 650px); background: #f8f7fb; }.file-fallback--download { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; }.file-fallback--download p { margin-top: 5px; }.file-type-badge { display: grid; place-items: center; width: 55px; height: 62px; border: 1px solid rgba(157,115,255,.3); border-radius: 6px 13px 13px 6px; color: var(--violet-bright); background: rgba(157,115,255,.08); font: 900 10px ui-monospace, monospace; }
.field-hint { color: var(--faint); font-size: 9px; }
.subgroup-filter { display: flex; align-items: center; gap: 7px; overflow-x: auto; margin: -10px 0 25px; padding: 9px 0; }.subgroup-filter > span { margin-right: 4px; color: var(--faint); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }.subgroup-filter a { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 9px; font-weight: 800; }.subgroup-filter a.is-active { color: var(--cyan); border-color: rgba(41,244,211,.28); background: rgba(41,244,211,.06); }.book-cover__group { position: absolute; top: 21px; right: 16px; max-width: 52%; overflow: hidden; padding: 4px 7px; border: 1px solid rgba(255,255,255,.13); border-radius: 99px; color: rgba(255,255,255,.65); background: rgba(0,0,0,.16); font-size: 7px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }

/* Admin v2 */
.admin-hero--new { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 35px; max-width: none; }.admin-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--line); }.admin-summary div { min-width: 120px; padding: 18px; background: rgba(18,15,30,.9); }.admin-summary strong, .admin-summary span { display: block; }.admin-summary strong { font-size: 26px; }.admin-summary span { color: var(--faint); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.admin-workspace { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 28px; align-items: start; }.admin-menu { position: sticky; top: 105px; display: grid; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: rgba(20,17,34,.72); }.admin-menu > span { padding: 10px; color: var(--faint); font-size: 8px; font-weight: 900; letter-spacing: .16em; }.admin-menu a { display: grid; grid-template-columns: 25px 1fr; gap: 9px; padding: 11px 9px; border-radius: 12px; }.admin-menu a:hover { background: rgba(157,115,255,.07); }.admin-menu i { color: var(--violet-bright); font: 900 8px ui-monospace, monospace; }.admin-menu strong, .admin-menu small { display: block; }.admin-menu strong { font-size: 10px; }.admin-menu small { margin-top: 2px; color: var(--faint); font-size: 8px; }
.admin-sections { display: grid; gap: 24px; min-width: 0; }.admin-section { scroll-margin-top: 105px; padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line); border-radius: 24px; background: rgba(20,17,34,.7); box-shadow: 0 20px 55px rgba(0,0,0,.16); }.admin-section__head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 21px; }.admin-section__head h2 { margin: 0; font-size: 27px; letter-spacing: -.04em; }.admin-section__head p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 11px; }.admin-section__head > span { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 50%; color: var(--violet-bright); font-size: 11px; font-weight: 900; }
.create-panel, .edit-item { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.018); }.create-panel { margin-bottom: 15px; border-color: rgba(157,115,255,.23); background: rgba(157,115,255,.035); }.create-panel summary, .edit-item summary { display: flex; align-items: center; gap: 11px; padding: 13px; cursor: pointer; list-style: none; }.create-panel summary::-webkit-details-marker, .edit-item summary::-webkit-details-marker { display: none; }.create-panel summary > span { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: var(--violet-bright); background: rgba(157,115,255,.09); }.create-panel summary > div, .edit-item summary > div { flex: 1; min-width: 0; }.create-panel summary strong, .create-panel summary small, .edit-item summary strong, .edit-item summary small { display: block; }.create-panel summary strong, .edit-item summary strong { font-size: 11px; }.create-panel summary small, .edit-item summary small { overflow: hidden; margin-top: 2px; color: var(--faint); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.create-panel summary > b, .edit-item summary > b { color: var(--faint); font-size: 9px; font-weight: 800; }.create-panel[open] summary > b, .edit-item[open] summary > b { transform: rotate(180deg); }
.compact-form, .edit-form { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); align-items: end; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }.compact-form--user { grid-template-columns: 1fr 1fr 1.2fr auto auto; }.compact-form .field input, .compact-form .field select, .edit-form .field input, .edit-form .field select { min-height: 40px; }.compact-form .primary-button, .edit-form .secondary-button { min-height: 40px; }
.edit-list { display: grid; gap: 7px; }.edit-list--cards { grid-template-columns: repeat(2, minmax(0,1fr)); }.edit-item summary > em { padding: 3px 6px; border: 1px solid rgba(157,115,255,.22); border-radius: 99px; color: var(--violet-bright); font: 900 7px ui-monospace, monospace; }.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }.status-dot.is-off { background: var(--danger); box-shadow: 0 0 10px var(--danger); }.subject-avatar { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid color-mix(in srgb, var(--subject, var(--violet)), transparent 55%); border-radius: 11px; background: color-mix(in srgb, var(--subject, var(--violet)) 8%, transparent); }.edit-form { grid-template-columns: repeat(3,minmax(0,1fr)); }.edit-form--resource { grid-template-columns: repeat(2,minmax(0,1fr)); }.edit-form > button { align-self: end; }.delete-line { display: flex; justify-content: flex-end; padding: 0 14px 14px; }.admin-empty { padding: 22px; border: 1px dashed var(--line); border-radius: 14px; color: var(--faint); text-align: center; font-size: 10px; }.edit-item summary > a { color: var(--violet-bright); font-size: 9px; font-weight: 800; }

@media (max-width: 1120px) {
  .hub-layout { grid-template-columns: 1fr; }
  .hub-sidebar { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hub-sidebar .news-widget { grid-column: 1 / -1; }
  .hub-hero__stats { margin-right: 0; }
  .signal-art { opacity: .55; }
  .admin-hero--new { grid-template-columns: 1fr; }
  .admin-summary { width: min(520px,100%); grid-template-columns: repeat(4,1fr); }
  .admin-summary div { min-width: 0; }
  .compact-form--user { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .hub-hero { grid-template-columns: 1fr; min-height: 380px; padding: 30px; }
  .hub-hero__stats { width: fit-content; }
  .signal-art { right: 8px; top: auto; bottom: 4px; }
  .hub-sidebar { grid-template-columns: 1fr; }.hub-sidebar .news-widget { grid-column: auto; }
  .messenger { grid-template-columns: 220px minmax(0,1fr); }
  .admin-workspace { grid-template-columns: 1fr; }.admin-menu { position: static; grid-template-columns: repeat(4,1fr); overflow-x: auto; }.admin-menu > span { display: none; }
  .compact-form, .edit-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .topbar__nav { justify-content: flex-start; overflow-x: auto; }
  .nav-link { flex: 0 0 auto; }
  .hub-hero { margin-top: -16px; border-radius: 23px; }.hub-hero h1 { font-size: 48px; }.hub-hero__copy > p { font-size: 14px; }.hub-hero__stats div { min-width: 78px; padding: 12px; }
  .composer-card { grid-template-columns: 1fr; }.composer-card > .avatar { display: none; }.composer-card__footer { align-items: stretch; flex-direction: column; }.composer-actions { justify-content: space-between; }.post-kinds { overflow-x: auto; }
  .feed-heading { align-items: stretch; flex-direction: column; }
  .post-card__text, .post-media, .text-meme, .post-card__actions, .comments { margin-left: 0; padding-left: 16px; padding-right: 16px; }.post-media, .text-meme { margin-right: 16px; margin-left: 16px; }.post-card__actions { margin: 0 16px; padding-left: 0; padding-right: 0; }.comments { padding-left: 16px; }
  .messenger { grid-template-columns: 1fr; }.messenger__contacts { max-height: 230px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--line); }.messenger__chat { height: 62vh; }.messages-intro h1 { font-size: 45px; }
  .notifications-head { align-items: stretch; flex-direction: column; }.notification-item { grid-template-columns: 40px 1fr auto; }.notification-item > b { display: none; }
  .file-fallback--download { grid-template-columns: 50px 1fr; }.file-fallback--download .primary-button { grid-column: 1 / -1; width: 100%; }
  .admin-summary { grid-template-columns: repeat(2,1fr); }.admin-menu { grid-template-columns: repeat(2,1fr); }.edit-list--cards { grid-template-columns: 1fr; }.compact-form, .compact-form--user, .edit-form, .edit-form--resource { grid-template-columns: 1fr; }
  .admin-section { padding: 18px 13px; }.edit-item summary > b { display: none; }.edit-item summary > a { display: none; }
}

/* Lecture notes */
.notes-hero { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 50px; overflow: hidden; margin: -24px 0 30px; padding: clamp(32px,5vw,66px); border: 1px solid rgba(41,244,211,.2); border-radius: 30px; background: radial-gradient(circle at 85% 12%, rgba(41,244,211,.14), transparent 32%), linear-gradient(130deg, rgba(30,24,53,.92), rgba(13,20,26,.82)); box-shadow: var(--shadow); }
.notes-hero::after { content: ""; position: absolute; right: -5%; bottom: -45%; width: 420px; aspect-ratio: 1; border: 1px solid rgba(41,244,211,.1); border-radius: 50%; box-shadow: 0 0 0 45px rgba(41,244,211,.025), 0 0 0 90px rgba(157,115,255,.025); pointer-events: none; }
.notes-hero > div { position: relative; z-index: 1; }.notes-hero h1 { margin: 0; font-size: clamp(48px,6vw,82px); line-height: .94; letter-spacing: -.065em; }.notes-hero h1 em { color: transparent; background: linear-gradient(100deg,#fff,var(--cyan)); -webkit-background-clip: text; background-clip: text; font-style: normal; }.notes-hero > div > p:not(.eyebrow) { max-width: 640px; margin: 22px 0; color: var(--muted); font-size: 16px; }
.notes-hero__stats { display: grid; grid-template-columns: repeat(3,minmax(95px,1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(7,8,14,.48); }.notes-hero__stats div { min-width: 105px; padding: 18px; border-right: 1px solid var(--line); }.notes-hero__stats div:last-child { border-right: 0; }.notes-hero__stats strong,.notes-hero__stats span { display: block; }.notes-hero__stats strong { font-size: 29px; letter-spacing: -.05em; }.notes-hero__stats span { color: var(--faint); font-size: 8px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.notes-toolbar { margin-bottom: 20px; }.notes-toolbar form { display: flex; align-items: center; gap: 8px; }.notes-toolbar label { display: flex; align-items: center; gap: 8px; min-width: min(440px,100%); height: 45px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); }.notes-toolbar label:focus-within { border-color: rgba(41,244,211,.4); }.notes-toolbar label > span { color: var(--cyan); }.notes-toolbar input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }.notes-toolbar__month { min-width: 185px !important; }.notes-toolbar button,.notes-toolbar form > a { height: 45px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.05); cursor: pointer; font-size: 10px; font-weight: 900; }.notes-toolbar form > a { display: inline-flex; align-items: center; color: var(--muted); }
.notes-heading { margin-top: 31px; }.notes-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }.note-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: rgba(20,17,34,.74); box-shadow: 0 18px 50px rgba(0,0,0,.2); transition: .24s ease; }.note-card:hover { border-color: color-mix(in srgb,var(--note,var(--violet)),transparent 48%); box-shadow: 0 24px 62px rgba(0,0,0,.3),0 0 30px color-mix(in srgb,var(--note,var(--violet)) 11%,transparent); transform: translateY(-3px); }.note-card__visual { position: relative; display: grid; place-items: center; height: 205px; overflow: hidden; background: radial-gradient(circle at 50% 30%,color-mix(in srgb,var(--note) 21%,transparent),transparent 45%), linear-gradient(145deg,#171225,#0c0a12); }.note-card__visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,transparent 45%,rgba(5,4,10,.7)); pointer-events: none; }.note-card__visual img { width: 100%; height: 100%; object-fit: cover; }.note-card__visual > span { color: color-mix(in srgb,var(--note),white 28%); font-size: 59px; filter: drop-shadow(0 0 25px color-mix(in srgb,var(--note) 30%,transparent)); }.note-card__visual > i { position: absolute; width: 130px; height: 95px; border: 1px solid color-mix(in srgb,var(--note),transparent 45%); border-radius: 5px 17px 17px 5px; transform: rotate(-7deg); }.note-card__visual > b { position: absolute; right: 15px; top: 14px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font: 900 8px ui-monospace,monospace; }.note-card__visual time { position: absolute; right: 13px; bottom: 12px; left: 13px; z-index: 2; color: #fff; font: 800 10px ui-monospace,monospace; }.note-card__body { padding: 18px; }.note-card__meta { display: flex; flex-wrap: wrap; gap: 5px; }.note-card__meta span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font-size: 7px; font-weight: 900; text-transform: uppercase; }.note-card h3 { margin: 12px 0 6px; font-size: 20px; line-height: 1.13; letter-spacing: -.035em; }.note-card__body > p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }.note-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); }.note-card__files { display: flex; gap: 4px; }.note-card__files span { padding: 3px 5px; border-radius: 5px; color: var(--cyan); background: rgba(41,244,211,.06); font: 900 7px ui-monospace,monospace; }.note-card footer small { overflow: hidden; color: var(--faint); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.note-card--add { display: grid; place-items: center; align-content: center; min-height: 355px; padding: 30px; border-style: dashed; text-align: center; }.note-card--add > span { color: var(--cyan); font-size: 45px; }.note-card--add strong { margin-top: 12px; font-size: 15px; }.note-card--add small { color: var(--faint); font-size: 9px; }
.note-files-drop { min-height: 185px; }.note-files-drop__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 9px; }.note-files-drop__list span,.note-files-drop__list strong { max-width: 200px; overflow: hidden; padding: 4px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.note-files-drop__list strong { color: var(--danger); border-color: rgba(255,96,127,.25); }
.lecture-note { max-width: 1180px; margin: 0 auto; }.lecture-note__head { display: grid; grid-template-columns: 132px minmax(0,1fr) auto; gap: clamp(22px,4vw,48px); align-items: start; padding: clamp(25px,4vw,48px); border: 1px solid var(--line); border-radius: 28px; background: radial-gradient(circle at 0 0,color-mix(in srgb,var(--note) 14%,transparent),transparent 34%),rgba(20,17,34,.78); box-shadow: var(--shadow); }.lecture-note__date { display: grid; place-items: center; min-height: 135px; padding: 16px; border: 1px solid color-mix(in srgb,var(--note),transparent 48%); border-radius: 8px 23px 23px 8px; background: color-mix(in srgb,var(--note) 8%,transparent); text-align: center; }.lecture-note__date > span { color: color-mix(in srgb,var(--note),white 35%); font-size: 58px; font-weight: 950; line-height: 1; letter-spacing: -.08em; }.lecture-note__date small { margin-top: 9px; color: var(--muted); font-size: 8px; text-transform: uppercase; }.lecture-note__meta { display: flex; flex-wrap: wrap; gap: 7px; }.lecture-note__meta span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; }.lecture-note__title h1 { margin: 17px 0 10px; font-size: clamp(40px,5vw,68px); line-height: .97; letter-spacing: -.055em; }.lecture-note__title > p { max-width: 700px; margin: 0 0 17px; color: var(--muted); font-size: 15px; }.lecture-note__title > small { color: var(--faint); font-size: 9px; }.lecture-note__paper { margin: 28px 0; }.lecture-files { margin-top: 37px; padding: clamp(20px,3vw,34px); border: 1px solid var(--line); border-radius: 25px; background: rgba(16,13,28,.7); }.lecture-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 25px; }.lecture-gallery a { position: relative; min-height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #09070e; }.lecture-gallery img { width: 100%; height: 100%; min-height: 180px; max-height: 430px; object-fit: cover; transition: .25s; }.lecture-gallery a:hover img { transform: scale(1.025); }.lecture-gallery span { position: absolute; right: 8px; bottom: 8px; left: 8px; overflow: hidden; padding: 6px 8px; border-radius: 8px; color: #fff; background: rgba(8,6,14,.7); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(8px); }.note-pdf { margin-top: 24px; }.note-pdf__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }.note-pdf__head > div { display: flex; align-items: center; min-width: 0; gap: 10px; }.note-pdf__head span { padding: 5px 7px; border-radius: 6px; color: var(--pink); background: rgba(255,79,216,.07); font: 900 8px ui-monospace,monospace; }.note-pdf__head strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.note-pdf__head > a { color: var(--violet-bright); font-size: 9px; font-weight: 900; }.lecture-documents { display: grid; gap: 8px; margin-top: 23px; }.lecture-documents > a { display: grid; grid-template-columns: 50px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }.lecture-documents > a:hover { border-color: rgba(157,115,255,.4); background: rgba(157,115,255,.06); }.lecture-documents > a > span { display: grid; place-items: center; width: 48px; height: 55px; border: 1px solid rgba(157,115,255,.3); border-radius: 5px 12px 12px 5px; color: var(--violet-bright); font: 900 8px ui-monospace,monospace; }.lecture-documents strong,.lecture-documents small { display: block; }.lecture-documents strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.lecture-documents small { margin-top: 3px; color: var(--faint); font-size: 8px; }.lecture-documents b { color: var(--violet-bright); font-size: 9px; }

@media (max-width: 1000px) { .notes-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.notes-hero { grid-template-columns: 1fr; }.notes-hero__stats { width: fit-content; }.lecture-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 680px) { .notes-hero { margin-top: -16px; padding: 28px 21px; border-radius: 23px; }.notes-hero h1 { font-size: 47px; }.notes-hero__stats { width: 100%; }.notes-hero__stats div { min-width: 0; padding: 13px 9px; }.notes-toolbar form { align-items: stretch; flex-wrap: wrap; }.notes-toolbar label { min-width: 100%; }.notes-toolbar__month { min-width: calc(65% - 4px) !important; }.notes-toolbar button { flex: 1; }.notes-grid { grid-template-columns: 1fr; }.note-card__visual { height: 220px; }.lecture-note__head { grid-template-columns: 83px 1fr; padding: 20px 16px; border-radius: 20px; }.lecture-note__head > form { grid-column: 1 / -1; justify-self: end; }.lecture-note__date { min-height: 95px; padding: 9px; }.lecture-note__date > span { font-size: 40px; }.lecture-note__title h1 { margin-top: 13px; font-size: 37px; }.lecture-note__meta span { font-size: 7px; }.lecture-note__paper { margin-right: -14px; margin-left: -14px; }.lecture-files { margin-right: -14px; margin-left: -14px; padding: 18px 10px; border-right: 0; border-left: 0; border-radius: 0; }.lecture-gallery { grid-template-columns: 1fr; }.lecture-gallery a,.lecture-gallery img { min-height: 230px; }.reader__page > .file-section .pdf-reader { margin-right: -19px; margin-left: -19px; }.note-pdf .pdf-reader { margin-right: 0; margin-left: 0; border-right: 1px solid var(--line-bright); border-left: 1px solid var(--line-bright); border-radius: 14px; }.lecture-documents > a { grid-template-columns: 45px minmax(0,1fr); }.lecture-documents b { grid-column: 2; }.lecture-documents > a > span { width: 43px; height: 50px; } }

/* Attachment editors */
.lecture-note__actions { display: flex; align-items: center; gap: 8px; }.lecture-note__actions form { display: contents; }.lecture-note__actions .secondary-button { min-height: 36px; padding: 0 12px; font-size: 9px; }
.resource-attachment { margin-top: 26px; }.resource-gallery { margin-bottom: 26px; }
.edit-studio { display: grid; gap: 24px; max-width: 1120px; margin: 0 auto; }.edit-studio__head { display: flex; align-items: end; justify-content: space-between; gap: 25px; padding: 10px 0 18px; }.edit-studio__head h1 { margin: 0; font-size: clamp(46px,6vw,76px); line-height: .96; letter-spacing: -.06em; }.edit-studio__head p:last-child { max-width: 650px; margin: 15px 0 0; color: var(--muted); }.edit-studio__head > span { display: grid; place-items: center; width: 92px; aspect-ratio: 1; border: 1px solid rgba(41,244,211,.24); border-radius: 25px; color: var(--cyan); background: rgba(41,244,211,.05); box-shadow: 0 0 35px rgba(41,244,211,.09); font-size: 38px; }
.attachment-manager { scroll-margin-top: 95px; padding: clamp(20px,3vw,32px); border: 1px solid var(--line); border-radius: 25px; background: rgba(20,17,34,.72); box-shadow: var(--shadow); }.attachment-manager > header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }.attachment-manager > header h2 { margin: 0; font-size: 29px; letter-spacing: -.045em; }.attachment-manager > header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; }.attachment-manager > header > strong { display: grid; place-items: center; min-width: 62px; height: 42px; border: 1px solid var(--line); border-radius: 99px; color: var(--violet-bright); font: 900 10px ui-monospace,monospace; }
.attachment-list { display: grid; gap: 8px; }.attachment-edit { display: grid; grid-template-columns: 48px minmax(150px,1fr) minmax(260px,.9fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.022); }.attachment-edit__icon { display: grid; place-items: center; width: 46px; height: 52px; border: 1px solid rgba(157,115,255,.28); border-radius: 5px 11px 11px 5px; color: var(--violet-bright); background: rgba(157,115,255,.06); font: 900 7px ui-monospace,monospace; }.attachment-edit__name { min-width: 0; }.attachment-edit__name strong,.attachment-edit__name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.attachment-edit__name strong { font-size: 11px; }.attachment-edit__name small { margin-top: 3px; color: var(--faint); font-size: 8px; }.attachment-edit > form { display: flex; align-items: center; gap: 7px; }.attachment-edit > form > label { position: relative; flex: 1; min-width: 0; overflow: hidden; }.attachment-edit > form > label input { position: absolute; width: 1px; height: 1px; opacity: 0; }.attachment-edit > form > label span,.attachment-edit > form > button:not(.danger-button) { display: flex; align-items: center; min-height: 35px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.03); cursor: pointer; font-size: 8px; font-weight: 900; }.attachment-edit > form > label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.attachment-edit > form > button:not(.danger-button) { color: var(--text); }.attachment-add { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 13px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }.attachment-add .file-drop { min-height: 150px; }.attachment-add > button { margin-bottom: 1px; }
@media (max-width: 850px) { .attachment-edit { grid-template-columns: 48px minmax(0,1fr) auto; }.attachment-edit > form:first-of-type { grid-column: 2 / -1; }.attachment-add { grid-template-columns: 1fr; }.attachment-add > button { width: 100%; } }
@media (max-width: 680px) { .lecture-note__actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }.edit-studio__head > span { display: none; }.attachment-manager { margin-right: -14px; margin-left: -14px; padding: 19px 12px; border-right: 0; border-left: 0; border-radius: 0; }.attachment-edit { grid-template-columns: 42px minmax(0,1fr); gap: 9px; }.attachment-edit > form:first-of-type,.attachment-edit > form:last-of-type { grid-column: 1 / -1; }.attachment-edit > form:last-of-type { justify-content: flex-end; }.attachment-edit__icon { width: 40px; height: 46px; }.reader__cover .book-cover { grid-row: span 3; } }

/* Themes, motion and the fixed mobile dock */
.theme-control { position: relative; display: inline-flex; }
.theme-toggle { color: var(--violet-bright); }
.theme-toggle[aria-expanded="true"] { border-color: color-mix(in srgb, var(--violet) 50%, transparent); background: color-mix(in srgb, var(--violet) 12%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--violet) 20%, transparent); transform: rotate(18deg); }
.theme-menu { position: absolute; top: calc(100% + 13px); right: 0; z-index: 90; display: grid; width: min(320px, calc(100vw - 24px)); padding: 10px; border: 1px solid var(--line-bright); border-radius: 20px; background: color-mix(in srgb, var(--panel-solid) 92%, transparent); box-shadow: 0 28px 80px rgba(0,0,0,.55), 0 0 35px color-mix(in srgb, var(--violet) 10%, transparent); backdrop-filter: blur(24px) saturate(145%); transform-origin: top right; animation: theme-menu-in .22s ease-out both; }
.theme-menu[hidden] { display: none; }
.theme-menu > div { padding: 8px 10px 12px; border-bottom: 1px solid var(--line); }
.theme-menu > div strong, .theme-menu > div small, .theme-menu button span, .theme-menu button small { display: block; }
.theme-menu > div strong { color: var(--text); font-size: 12px; }
.theme-menu > div small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.theme-menu button { display: grid; grid-template-columns: 36px 1fr 18px; align-items: center; gap: 10px; width: 100%; padding: 9px; border: 0; border-radius: 13px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.theme-menu button:hover, .theme-menu button.is-active { color: var(--text); background: color-mix(in srgb, var(--violet) 10%, transparent); }
.theme-menu button span { font-size: 11px; font-weight: 850; }
.theme-menu button small { margin-top: 1px; color: var(--faint); font-size: 8px; font-weight: 600; }
.theme-menu button b { color: var(--cyan); opacity: 0; }
.theme-menu button.is-active b { opacity: 1; }
.theme-swatch { display: block; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; box-shadow: inset 0 1px rgba(255,255,255,.16), 0 8px 22px rgba(0,0,0,.2); }
.theme-swatch--ultraviolet { background: linear-gradient(135deg,#9d73ff,#ff4fd8 55%,#29f4d3); }
.theme-swatch--acid { background: linear-gradient(135deg,#9dff4f,#ffe747 55%,#47ffc2); }
.theme-swatch--ocean { background: linear-gradient(135deg,#458cff,#49d9ff 55%,#68ffe1); }
.theme-swatch--sunset { background: linear-gradient(135deg,#ff664c,#ff4f9a 55%,#ffd15c); }
@keyframes theme-menu-in { from { opacity: 0; transform: translateY(-7px) scale(.97); } }

.ambient__cursor { position: absolute; top: -170px; left: -170px; width: 340px; height: 340px; border-radius: 50%; opacity: .1; background: radial-gradient(circle, var(--cyan), transparent 66%); filter: blur(30px); will-change: transform; transition: opacity .3s; }
.hub-hero { padding-bottom: clamp(76px, 7vw, 96px); }
.hub-hero h1 [data-greeting] { display: inline; }
.hub-hero h1 em { background-size: 200% 100%; animation: headline-glow 6s ease-in-out infinite alternate; }
.chaos-ticker { position: absolute; right: 0; bottom: 0; left: 0; z-index: 3; overflow: hidden; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-deep) 67%, transparent); backdrop-filter: blur(12px); }
.chaos-ticker > div { display: flex; align-items: center; gap: 25px; width: max-content; min-height: 37px; padding-left: 25px; color: var(--muted); font: 900 8px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .15em; white-space: nowrap; animation: chaos-scroll 22s linear infinite; }
.chaos-ticker i { color: var(--cyan); font-style: normal; text-shadow: 0 0 13px var(--cyan); }
@keyframes chaos-scroll { to { transform: translateX(-50%); } }
@keyframes headline-glow { 50% { background-position: 100% 50%; filter: drop-shadow(0 0 15px color-mix(in srgb, var(--violet) 25%, transparent)); } }

.widget, .post-card, .composer-card { position: relative; }
.widget::after, .post-card::after, .composer-card::after { content: ""; position: absolute; top: -120%; left: -75%; width: 45%; height: 340%; z-index: 0; opacity: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.055), transparent); pointer-events: none; transform: rotate(22deg); transition: left .7s ease, opacity .25s; }
.widget:hover::after, .post-card:hover::after, .composer-card:hover::after { left: 135%; opacity: 1; }
.widget > *, .post-card > *, .composer-card > * { position: relative; z-index: 1; }
.motion-ready .reveal-item { opacity: .01; filter: blur(7px); transform: translateY(18px); }
.motion-ready .reveal-item.is-revealed { opacity: 1; filter: blur(0); transform: translateY(0); transition: opacity .55s ease var(--reveal-delay), filter .55s ease var(--reveal-delay), transform .55s cubic-bezier(.2,.8,.2,1) var(--reveal-delay); }

html[data-theme="acid"] .topbar__nav, html[data-theme="acid"] .theme-menu { border-radius: 10px; }
html[data-theme="acid"] .brand__mark { border-radius: 3px 9px 9px 3px; }
html[data-theme="acid"] .ambient__grid { opacity: .2; }
html[data-theme="sunset"] .topbar__nav { border-radius: 18px; }
html[data-theme="sunset"] .brand__mark { border-radius: 15px 22px 22px 15px; }

@media (max-width: 920px) {
  .topbar { grid-template-columns: minmax(0,1fr) auto; min-height: 68px; padding: 9px max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left)); }
  .topbar__nav {
    position: fixed;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    width: auto;
    min-width: 0;
    padding: 5px;
    overflow: visible;
    border-radius: 22px;
    background: var(--nav-bg);
    box-shadow: 0 20px 55px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.06);
    backdrop-filter: blur(22px) saturate(140%);
    transform: translateZ(0);
  }
  .nav-link { position: relative; display: flex; min-width: 0; min-height: 52px; padding: 5px 2px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 16px; font-size: 9px; line-height: 1; text-align: center; white-space: nowrap; }
  .nav-link__icon { display: block; height: 20px; font-size: 18px; font-weight: 500; line-height: 20px; }
  .nav-link__full { display: none; }
  .nav-link__short { display: block; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
  .nav-link.is-active { color: var(--text); background: color-mix(in srgb, var(--violet) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 18%, transparent); }
  .nav-link--accent { color: #100817; }
  .nav-link--accent.is-active { color: #100817; background: linear-gradient(135deg, var(--violet-bright), var(--accent-soft)); }
  .nav-badge { position: absolute; top: 3px; right: max(7px, 18%); margin: 0; border: 2px solid var(--nav-bg); }
  .page-shell { padding-bottom: calc(116px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .brand { gap: 8px; }
  .brand__mark { width: 34px; height: 38px; }
  .brand strong { font-size: 13px; }
  .user-chip { gap: 5px; }
  .icon-button { width: 32px; height: 32px; }
  .hub-hero { min-height: 410px; padding: 27px 21px 72px; }
  .hub-hero h1 { font-size: clamp(39px, 12vw, 48px); }
  .hub-hero__stats { width: 100%; }
  .hub-hero__stats div { flex: 1; min-width: 0; }
  .signal-art { opacity: .32; }
  .theme-menu { position: fixed; top: 72px; right: 10px; }
}

@media (max-width: 360px) {
  .brand > span:last-child { display: none; }
  .nav-link { font-size: 8px; }
  .nav-link__icon { font-size: 17px; }
}

@media (hover: none), (pointer: coarse) {
  .ambient__cursor { display: none; }
  .widget::after, .post-card::after, .composer-card::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chaos-ticker > div, .hub-hero h1 em { animation: none; }
  .ambient__cursor { display: none; }
  .motion-ready .reveal-item, .motion-ready .reveal-item.is-revealed { opacity: 1; filter: none; transform: none; }
}
