/* =========================================================================
   TechPlus — design tokens + components
   Palette: leaf green on a faintly green-tinted paper, green-black ink.
   Type: Bricolage Grotesque (headings) + DM Sans (text) + JetBrains Mono (code only)
   ========================================================================= */
:root {
  --bg: #F3F6F1;
  --surface: #FFFFFF;
  --surface-2: #EDF2EA;
  --surface-3: #E3EBDF;
  --line: #DCE5D8;
  --line-strong: #C7D3C2;
  --ink: #0F1C14;
  --ink-2: #46574C;
  --ink-3: #78877D;
  --green: #16A34A;
  --green-ink: #15803D;
  --green-deep: #14532D;
  --green-bright: #22C55E;
  --green-soft: #DCFCE7;
  --green-wash: #F0FDF4;
  --teal: #0D9488;
  --teal-soft: #CCFBF1;
  --amber: #B45309;
  --amber-soft: #FEF3C7;
  --violet: #6D28D9;
  --violet-soft: #EDE9FE;
  --blue: #1D4ED8;
  --blue-soft: #DBEAFE;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --shadow-pop: 0 12px 32px -8px rgba(15, 40, 22, .22), 0 2px 6px rgba(15, 40, 22, .08);
  --radius-card: 16px;
  --radius-ctl: 10px;
  --font-head: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --topbar-h: 56px;
  --bottombar-h: 62px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B1310;
  --surface: #121D17;
  --surface-2: #18251E;
  --surface-3: #203028;
  --line: #22332A;
  --line-strong: #2E4437;
  --ink: #E6F1EA;
  --ink-2: #A5B8AB;
  --ink-3: #718579;
  --green: #22C55E;
  --green-ink: #4ADE80;
  --green-deep: #BBF7D0;
  --green-soft: rgba(34, 197, 94, .16);
  --green-wash: rgba(34, 197, 94, .07);
  --teal-soft: rgba(45, 212, 191, .15);
  --teal: #2DD4BF;
  --amber: #FBBF24;
  --amber-soft: rgba(251, 191, 36, .14);
  --violet: #A78BFA;
  --violet-soft: rgba(167, 139, 250, .15);
  --blue: #93C5FD;
  --blue-soft: rgba(147, 197, 253, .14);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, .14);
  --shadow-pop: 0 16px 40px -10px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 .75em; }
a { color: var(--green-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
[x-cloak], [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: .86rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: .6rem; }
.row-wrap { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .6rem; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font: 700 1.28rem/1 var(--font-head); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--green); position: relative; flex: none;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.14);
}
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: #fff; border-radius: 2px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.brand-mark::before { width: 16px; height: 4px; }
.brand-mark::after { width: 4px; height: 16px; }

/* ---------- app shell ---------- */
.shell {
  display: grid; grid-template-columns: 236px minmax(0, 640px) 320px; gap: 28px;
  max-width: 1280px; margin: 0 auto; padding: 0 20px; align-items: start;
}
.leftnav { position: sticky; top: 0; height: 100vh; padding: 18px 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.leftnav .brand { padding: 4px 12px 16px; }
.navlink {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; color: var(--ink);
  font-weight: 500; font-size: 1rem; position: relative;
}
.navlink:hover { background: var(--surface-2); text-decoration: none; }
.navlink.active { font-weight: 700; background: var(--green-wash); color: var(--green-deep); }
[data-theme="dark"] .navlink.active { color: var(--green-ink); }
.navlink .count { margin-left: auto; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.count:empty, .count[data-n="0"] { display: none; }
.nav-create { margin: 12px 0 6px; justify-content: center; }
.nav-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; }
.nav-me:hover { background: var(--surface-2); }
.main { min-width: 0; padding: 18px 0 64px; }
.rightbar { position: sticky; top: 0; padding: 18px 0; max-height: 100vh; overflow-y: auto; scrollbar-width: none; }
.rightbar::-webkit-scrollbar { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 1.45rem; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 500; margin-bottom: 10px; }

.topbar, .bottombar { display: none; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 76px minmax(0, 640px) 300px; gap: 20px; }
  .leftnav .label, .leftnav .brand-word, .nav-me .who { display: none; }
  .leftnav .brand { padding: 4px 0 16px 10px; }
  .navlink { justify-content: center; padding: 12px; }
  .navlink .count { position: absolute; top: 4px; right: 6px; margin: 0; }
  .nav-create { padding: 0; width: 48px; height: 48px; align-self: center; }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .rightbar { display: none; }
}
@media (max-width: 720px) {
  .shell { display: block; padding: 0; }
  .leftnav { display: none; }
  .main { padding: calc(var(--topbar-h) + 10px) 12px calc(var(--bottombar-h) + 24px); }
  .topbar {
    display: flex; position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 40; align-items: center;
    justify-content: space-between; padding: 0 12px; background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .topbar .actions { display: flex; gap: 2px; }
  .bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; height: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); z-index: 40;
  }
  .bottombar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); font-size: .68rem; font-weight: 600; position: relative; }
  .bottombar a.active { color: var(--green-ink); }
  .bottombar a:hover { text-decoration: none; }
  .bottombar .plus { width: 46px; height: 46px; border-radius: 15px; background: var(--green); color: #fff; display: grid; place-items: center; margin: auto; box-shadow: 0 6px 16px -4px rgba(22,163,74,.55); }
  .bottombar .count { position: absolute; top: 6px; left: calc(50% + 4px); }
  .page-head h1 { font-size: 1.25rem; }
}

/* ---------- cards & surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.card-pad { padding: 16px 18px; }
.card + .card { margin-top: 12px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 14px 16px; margin-bottom: 14px; }
.side-card h3 { font-size: 1rem; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.side-card h3 a { font: 500 .82rem var(--font-body); }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 8px 0; display: flex; align-items: center; gap: 10px; }
.side-list li + li { border-top: 1px solid var(--line); }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent;
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem; line-height: 1.2; white-space: nowrap;
  background: var(--surface-2); color: var(--ink); transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-ink); }
[data-theme="dark"] .btn-primary { color: #06220F; }
[data-theme="dark"] .btn-primary:hover { background: #4ADE80; }
.btn-outline { background: transparent; border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .84rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: transparent; color: var(--ink-2); }
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }
.btn-following { background: transparent; border-color: var(--line-strong); }
.btn-following:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-ctl); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input.is-invalid, .textarea.is-invalid, .select.is-invalid { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: .82rem; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--green); margin-top: 2px; flex: none; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-of-type { border-bottom: 0; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.search-box { position: relative; }
.search-box .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-box .input { padding-left: 40px; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.search-box .input:focus { background: var(--surface); }

/* ---------- alerts & chips ---------- */
.alert { padding: 11px 14px; border-radius: 12px; font-size: .92rem; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--green-soft); color: var(--green-deep); }
[data-theme="dark"] .alert-success { color: var(--green-ink); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--blue-soft); color: var(--blue); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2);
  color: var(--ink-2); font-size: .8rem; font-weight: 600; line-height: 1.5; border: 1px solid transparent;
}
a.chip:hover { text-decoration: none; background: var(--surface-3); color: var(--ink); }
.chip.is-on { background: var(--green); color: #fff; }
[data-theme="dark"] .chip.is-on { color: #06220F; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.type-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; font-size: .74rem; font-weight: 700; }
.type-question { background: var(--teal-soft); color: var(--teal); }
.type-discussion { background: var(--violet-soft); color: var(--violet); }
.type-project { background: var(--green-soft); color: var(--green-ink); }
.type-resource { background: var(--blue-soft); color: var(--blue); }
.type-solved { background: var(--amber-soft); color: var(--amber); }

/* ---------- avatars ---------- */
.avatar {
  --s: 42px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center;
  background: var(--green-soft); color: var(--green-deep); font: 700 calc(var(--s) * .38)/1 var(--font-head); position: relative;
}
[data-theme="dark"] .avatar { color: var(--green-ink); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --s: 26px; } .avatar-sm { --s: 34px; } .avatar-lg { --s: 56px; } .avatar-xl { --s: 112px; }
.avatar-wrap { position: relative; display: inline-block; }
.online-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--green-bright); border: 2px solid var(--surface); }
.verified { display: inline-flex; width: 16px; height: 16px; color: var(--green); vertical-align: -2px; }
.verified svg { width: 100%; height: 100%; }
.name-line { display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); min-width: 0; }
.name-line a { color: inherit; }
.handle { color: var(--ink-3); font-size: .86rem; }
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-row .meta { min-width: 0; flex: 1; }
.user-row .meta > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- composer ---------- */
.composer { padding: 14px 16px; margin-bottom: 14px; }
.composer-types { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; scrollbar-width: none; }
.composer-types::-webkit-scrollbar { display: none; }
.composer-types button { border: 1px solid var(--line); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.composer-types button.is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.composer textarea { border: 0; background: transparent; padding: 6px 0; min-height: 64px; font-size: 1.02rem; resize: none; width: 100%; }
.composer textarea:focus, .composer .title-input:focus { outline: none; box-shadow: none; }
.composer .title-input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 0; font: 650 1.08rem var(--font-head); width: 100%; background: transparent; }
.composer-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; flex-wrap: wrap; }
.composer-tools .tools { display: flex; gap: 2px; flex-wrap: wrap; }
.composer-tools .tools .btn-icon { color: var(--green-ink); width: 36px; height: 36px; }
.composer .select { width: auto; max-width: 190px; padding: 6px 10px; font-size: .85rem; border-radius: 999px; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.preview { position: relative; width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.preview img, .preview video { width: 100%; height: 100%; object-fit: cover; }
.preview.file { width: auto; min-width: 150px; max-width: 240px; height: auto; padding: 10px 34px 10px 12px; font-size: .82rem; display: flex; gap: 8px; align-items: center; }
.preview .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; padding: 0; }
.preview .rm .ico { width: 14px; height: 14px; }
.sticker-preview { width: 110px; height: 110px; }
.sticker-preview img { object-fit: contain; }
.composer-extra { display: grid; gap: 8px; margin: 8px 0 2px; }
.composer-extra .input { padding: 8px 12px; font-size: .9rem; }
.composer-collapsed { display: flex; align-items: center; gap: 12px; cursor: text; }
.composer-collapsed .fake-input { flex: 1; padding: 10px 16px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); }

/* ---------- popovers (emoji / sticker / reactions / menus) ---------- */
.pop-anchor { position: relative; }
.popover {
  position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-pop); padding: 8px;
}
.emoji-grid { display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; max-height: 220px; overflow-y: auto; }
.emoji-grid button { border: 0; background: transparent; font-size: 1.3rem; width: 34px; height: 34px; border-radius: 8px; padding: 0; }
.emoji-grid button:hover { background: var(--surface-2); }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 72px); gap: 6px; max-height: 260px; overflow-y: auto; }
.sticker-grid button { border: 0; background: var(--surface-2); border-radius: 10px; padding: 4px; width: 72px; height: 72px; }
.sticker-grid button:hover { background: var(--green-soft); }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; }
.pop-title { font-size: .78rem; font-weight: 700; color: var(--ink-3); padding: 2px 4px 8px; }
.menu { min-width: 190px; padding: 6px; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: transparent; border-radius: 9px; color: var(--ink); font-size: .9rem; font-weight: 500; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- post card ---------- */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); margin-bottom: 12px; }
.post-head { display: flex; gap: 11px; padding: 14px 16px 0; align-items: flex-start; }
.post-head .who { flex: 1; min-width: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ink-3); font-size: .82rem; margin-top: 1px; }
.post-meta a { color: var(--ink-3); }
.post-meta .community-link { color: var(--ink-2); font-weight: 600; }
.post-body { padding: 10px 16px 4px; overflow-wrap: anywhere; }
.post-title { font-size: 1.12rem; margin: 2px 0 6px; }
.post-title a { color: var(--ink); }
.post-text { white-space: normal; }
.post-text a.tag, .post-text a.mention, .comment-text a.tag, .comment-text a.mention { font-weight: 600; }
.post-text.clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
pre.code { background: #0E1A13; color: #D5F5E0; font: .84rem/1.55 var(--font-mono); padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 8px 0; }
code.inline { font-family: var(--font-mono); font-size: .86em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.link-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; color: var(--ink); }
.link-card:hover { background: var(--surface-2); text-decoration: none; }
.post-sticker { width: 150px; height: 150px; object-fit: contain; margin: 6px 0; }
.media-grid { display: grid; gap: 3px; margin: 10px 0 4px; border-radius: 12px; overflow: hidden; }
.media-grid.n1 { grid-template-columns: 1fr; }
.media-grid.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 10; }
.media-grid.n3 > :first-child { grid-row: span 2; }
.media-grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1; }
.media-grid button { border: 0; padding: 0; background: var(--surface-2); position: relative; overflow: hidden; min-height: 0; }
.media-grid img { width: 100%; height: 100%; object-fit: cover; }
.media-grid.n1 img { max-height: 560px; object-fit: contain; background: var(--surface-2); }
.media-grid .more { position: absolute; inset: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font: 700 1.6rem var(--font-head); }
.post-video { width: 100%; max-height: 520px; background: #000; border-radius: 12px; margin: 10px 0 4px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: var(--surface); }
.file-row + .file-row { margin-top: 6px; }
.file-ext { width: 42px; height: 46px; border-radius: 8px; display: grid; place-items: center; font: 700 .68rem var(--font-mono); text-transform: uppercase; color: #fff; background: var(--ink-2); flex: none; }
.file-ext.pdf { background: #DC2626; } .file-ext.doc { background: #2563EB; } .file-ext.slides { background: #EA580C; }
.file-ext.sheet { background: #16A34A; } .file-ext.archive { background: #7C3AED; } .file-ext.code { background: #0F1C14; }
[data-theme="dark"] .file-ext.code { background: #34463B; }
.file-row .info { flex: 1; min-width: 0; }
.file-row .name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0 4px; background: var(--green-wash); }
.project-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.shared { border: 1px solid var(--line); border-radius: 14px; margin: 10px 0 4px; overflow: hidden; }
.shared .post-head { padding: 10px 12px 0; }
.shared .post-body { padding: 8px 12px 10px; }
.shared.missing { padding: 14px; color: var(--ink-3); font-size: .9rem; }
.post-stats { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; color: var(--ink-3); font-size: .84rem; }
.post-stats .emojis { display: inline-flex; margin-right: 6px; }
.post-stats .emojis span { font-size: .95rem; margin-right: -3px; }
.post-actions { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding: 4px 8px; }
.post-actions > * { min-width: 0; }
.act {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 9px 4px; border: 0; background: transparent;
  color: var(--ink-2); font-weight: 600; font-size: .88rem; border-radius: 10px;
}
.act:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.act .emoji { font-size: 1.1rem; line-height: 1; }
.act.is-on { color: var(--green-ink); }
.act.is-on[data-reaction="love"], .act.is-on[data-reaction="angry"] { color: var(--danger); }
.act.is-on[data-reaction="haha"], .act.is-on[data-reaction="wow"], .act.is-on[data-reaction="sad"], .act.is-on[data-reaction="idea"], .act.is-on[data-reaction="fire"] { color: var(--amber); }
.act.saved { color: var(--green-ink); }
.act.saved .ico { fill: currentColor; }
@media (max-width: 420px) { .act .lbl { display: none; } }

.react-wrap { position: relative; }
.reaction-picker {
  position: absolute; bottom: calc(100% + 6px); left: 0; display: flex; gap: 2px; padding: 5px 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-pop); z-index: 50;
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(.96); transform-origin: bottom left; transition: .16s ease;
}
.reaction-picker.open { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) {
  .react-wrap:hover .reaction-picker { opacity: 1; visibility: visible; transform: none; transition-delay: .35s; }
}
.reaction-picker button { border: 0; background: transparent; font-size: 1.55rem; width: 40px; height: 40px; border-radius: 50%; padding: 0; transition: transform .12s; position: relative; }
.reaction-picker button:hover { transform: scale(1.28) translateY(-3px); }
.reaction-picker button[title]:hover::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }

/* ---------- Q&A ---------- */
.vote-col { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 42px; }
.vote-col button { border: 1px solid var(--line); background: var(--surface); width: 36px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); padding: 0; }
.vote-col button:hover { border-color: var(--green); color: var(--green-ink); }
.vote-col button.is-on { background: var(--green); border-color: var(--green); color: #fff; }
.vote-col .score { font: 700 1.05rem var(--font-head); }
.qa-layout { display: flex; gap: 12px; }
.qa-layout > .grow { min-width: 0; }
.best-flag { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; color: var(--amber); background: var(--amber-soft); padding: 3px 10px; border-radius: 999px; }
.q-row { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.q-row:last-child { border-bottom: 0; }
.q-stats { display: flex; flex-direction: column; gap: 4px; min-width: 74px; text-align: right; font-size: .8rem; color: var(--ink-3); }
.q-stats b { color: var(--ink); font-size: .95rem; }
.q-stats .answered { color: var(--green-ink); }
.q-stats .solved { background: var(--green); color: #fff; border-radius: 6px; padding: 1px 6px; text-align: center; }

/* ---------- comments ---------- */
.comments { padding: 4px 16px 16px; }
.comment { display: flex; gap: 10px; margin-top: 14px; }
.comment .bubble { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 8px 12px; display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.comment.is-best > .grow > .bubble { background: var(--amber-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 35%, transparent); }
.comment .c-name { font-weight: 700; font-size: .88rem; display: flex; gap: 5px; align-items: center; }
.comment .c-name a { color: var(--ink); }
.comment-text { font-size: .94rem; }
.comment .c-img { max-width: 260px; border-radius: 10px; margin-top: 6px; cursor: zoom-in; }
.comment .c-sticker { width: 110px; height: 110px; object-fit: contain; margin-top: 4px; }
.c-actions { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .8rem; color: var(--ink-3); padding: 4px 4px 0; align-items: center; }
.c-actions button, .c-actions a { border: 0; background: none; padding: 2px 0; color: var(--ink-2); font-weight: 700; font-size: .8rem; }
.c-actions button:hover { color: var(--ink); text-decoration: underline; }
.c-actions .is-on { color: var(--green-ink); }
.c-actions .react-wrap .reaction-picker { bottom: calc(100% + 2px); }
.c-actions .c-react-count { display: inline-flex; align-items: center; gap: 2px; }
.replies { margin-left: 4px; padding-left: 14px; border-left: 2px solid var(--line); }
.comment-form { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.comment-form .box { flex: 1; min-width: 0; background: var(--surface-2); border-radius: 18px; padding: 6px 6px 6px 14px; display: flex; align-items: flex-end; gap: 4px; border: 1px solid transparent; }
.comment-form .box:focus-within { border-color: var(--green); background: var(--surface); }
.comment-form textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 24px; max-height: 180px; padding: 6px 0; line-height: 1.4; outline: none; }
.comment-form .btn-icon { width: 32px; height: 32px; }
.comment-form .send { color: var(--green-ink); }
.comment-form .previews { margin-top: 6px; }

/* ---------- profile ---------- */
.profile-cover { height: 210px; border-radius: var(--radius-card) var(--radius-card) 0 0; background:
  linear-gradient(135deg, var(--green-deep), var(--green) 60%, var(--green-bright)); position: relative; overflow: hidden; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover.plain::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.18) 1.5px, transparent 1.6px); background-size: 22px 22px; }
.profile-card { border-top: 0; border-radius: 0 0 var(--radius-card) var(--radius-card); padding: 0 18px 18px; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -56px; gap: 10px; flex-wrap: wrap; }
.profile-top .avatar { border: 4px solid var(--surface); }
.profile-name { font-size: 1.45rem; margin: 10px 0 0; display: flex; align-items: center; gap: 6px; }
.profile-name .verified { width: 20px; height: 20px; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: .88rem; margin: 10px 0; }
.profile-facts span, .profile-facts a { display: inline-flex; gap: 5px; align-items: center; }
.profile-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; }
.profile-stats a, .profile-stats span { color: var(--ink-2); font-size: .9rem; }
.profile-stats b { color: var(--ink); font: 700 1.05rem var(--font-head); margin-right: 3px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--ink-2); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--green); }
.media-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.media-wall a { aspect-ratio: 1; background: var(--surface-2); position: relative; border-radius: 6px; overflow: hidden; }
.media-wall img, .media-wall video { width: 100%; height: 100%; object-fit: cover; }
.media-wall .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.25); }

/* ---------- communities & projects ---------- */
.community-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex: none; overflow: hidden; background: var(--c, var(--green)); }
.community-icon.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 1rem; }
.community-icon.lg { width: 76px; height: 76px; border-radius: 20px; font-size: 2.2rem; border: 4px solid var(--surface); }
.community-icon img { width: 100%; height: 100%; object-fit: cover; }
.community-icon.tint { background: color-mix(in srgb, var(--c, var(--green)) 16%, var(--surface)); }
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.community-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.community-card p { color: var(--ink-2); font-size: .88rem; margin: 0; flex: 1; }
.community-hero { height: 150px; border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--c, var(--green)); position: relative; overflow: hidden; }
.community-hero img { width: 100%; height: 100%; object-fit: cover; }
.community-hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(90deg, rgba(255,255,255,.12) 2px, transparent 2px), linear-gradient(rgba(255,255,255,.12) 2px, transparent 2px); background-size: 28px 28px; background-position: 13px 13px; mix-blend-mode: soft-light; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.project-card { overflow: hidden; display: flex; flex-direction: column; }
.project-card .thumb { aspect-ratio: 16 / 10; background: var(--green-wash); display: grid; place-items: center; overflow: hidden; color: var(--green); }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-card h3 { margin: 0; font-size: 1.02rem; }
.project-card h3 a { color: var(--ink); }
.filter-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar .chip { padding: 6px 13px; font-size: .84rem; white-space: nowrap; }

/* ---------- notifications ---------- */
.notif { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink); align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: var(--green-wash); }
.notif .n-ico { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; border: 2px solid var(--surface); }
.notif .n-ico .ico { width: 12px; height: 12px; stroke-width: 2.4; }
.notif .n-sys { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }

/* ---------- messages ---------- */
.chat-shell { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 36px); min-height: 480px; overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list .head { padding: 14px 16px 10px; }
.chat-list .items { overflow-y: auto; flex: 1; }
.convo { display: flex; gap: 10px; padding: 10px 16px; align-items: center; color: var(--ink); }
.convo:hover { background: var(--surface-2); text-decoration: none; }
.convo.active { background: var(--green-wash); }
.convo .preview-text { color: var(--ink-3); font-size: .84rem; }
.convo.has-unread .preview-text { color: var(--ink); font-weight: 600; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 3px; background: var(--bg); }
.msg { max-width: 76%; display: flex; flex-direction: column; align-items: flex-start; position: relative; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg .b { background: var(--surface); border: 1px solid var(--line); padding: 8px 12px; border-radius: 16px 16px 16px 5px; overflow-wrap: anywhere; font-size: .94rem; }
.msg.mine .b { background: var(--green); color: #fff; border-color: transparent; border-radius: 16px 16px 5px 16px; }
[data-theme="dark"] .msg.mine .b { background: #166534; }
.msg.mine .b a { color: #fff; text-decoration: underline; }
.msg .b.deleted { font-style: italic; opacity: .7; background: transparent !important; color: var(--ink-3) !important; border: 1px dashed var(--line-strong) !important; }
.msg .meta { font-size: .7rem; color: var(--ink-3); margin: 2px 6px 6px; display: flex; gap: 6px; align-items: center; }
.msg .quote { font-size: .78rem; border-left: 3px solid var(--green); padding: 3px 8px; margin-bottom: 4px; background: var(--surface-2); border-radius: 6px; color: var(--ink-2); }
.msg .sticker { width: 130px; height: 130px; object-fit: contain; }
.msg .att-img { max-width: 260px; border-radius: 12px; margin-bottom: 3px; cursor: zoom-in; }
.msg .att-file { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: .85rem; margin-bottom: 3px; }
.msg .tools { position: absolute; top: 2px; display: none; gap: 2px; }
.msg.mine .tools { right: calc(100% + 4px); }
.msg:not(.mine) .tools { left: calc(100% + 4px); }
.msg:hover .tools { display: flex; }
.msg .tools button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink-2); display: grid; place-items: center; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.day-sep { align-self: center; font-size: .72rem; font-weight: 700; color: var(--ink-3); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; margin: 10px 0; }
.typing { font-size: .8rem; color: var(--green-ink); padding: 0 16px 6px; height: 22px; background: var(--bg); }
.typing span { display: inline-block; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.chat-input { border-top: 1px solid var(--line); padding: 10px 12px; background: var(--surface); }
.chat-input .reply-bar { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; margin-bottom: 8px; border-left: 3px solid var(--green); }
.chat-input form { display: flex; gap: 6px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; border-radius: 21px; padding: 10px 16px; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--ink-2); }
@media (max-width: 720px) {
  .chat-shell { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - var(--bottombar-h) - 30px); border-radius: 12px; }
  .chat-shell.has-active .chat-list { display: none; }
  .chat-shell:not(.has-active) .chat-pane { display: none; }
  .msg { max-width: 86%; }
}

/* ---------- empty, load more, toasts, modal, lightbox ---------- */
.empty { text-align: center; padding: 42px 22px; color: var(--ink-2); }
.empty .glyph { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--green-soft); color: var(--green-ink); display: grid; place-items: center; }
.empty .glyph .ico { width: 30px; height: 30px; }
.empty h3 { color: var(--ink); }
.empty p { max-width: 38ch; margin: 0 auto 14px; }
.load-more { display: flex; justify-content: center; padding: 8px 0 20px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 720px) { #toasts { bottom: calc(var(--bottombar-h) + 16px); } }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-pop); animation: toastIn .2s ease; pointer-events: auto; max-width: 90vw; display: flex; gap: 8px; align-items: center; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
dialog.modal { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink); width: min(460px, calc(100vw - 24px)); box-shadow: var(--shadow-pop); }
dialog.modal::backdrop { background: rgba(6, 18, 11, .55); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 16px 18px 18px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.share-grid a, .share-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .78rem; font-weight: 600; }
.share-grid a:hover, .share-grid button:hover { background: var(--surface-2); text-decoration: none; }
.share-grid .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; }
.reason-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.reason-list label { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: flex; gap: 8px; align-items: center; font-size: .88rem; font-weight: 600; cursor: pointer; }
.reason-list input { accent-color: var(--green); }
.reason-list label:has(input:checked) { border-color: var(--green); background: var(--green-wash); }
.lightbox { position: fixed; inset: 0; background: rgba(4, 10, 7, .94); z-index: 200; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; }
.lightbox .lb-next { right: 16px; top: 50%; }
.lightbox .lb-count { position: absolute; bottom: 18px; color: #cfe; font-size: .85rem; }
.mention-pop { position: absolute; z-index: 80; min-width: 220px; }
.mention-pop button { display: flex; gap: 8px; align-items: center; width: 100%; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; text-align: left; }
.mention-pop button.on, .mention-pop button:hover { background: var(--surface-2); }

/* ---------- announcement, trending ---------- */
.announce { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius-card); background: var(--green-deep); color: #EAFBEF; position: relative; }
[data-theme="dark"] .announce { background: #123D22; }
.announce h3 { color: #fff; margin-bottom: 2px; font-size: 1rem; }
.announce p { margin: 0; font-size: .9rem; opacity: .9; }
.announce a { color: #BBF7D0; font-weight: 600; }
.announce .close { position: absolute; top: 8px; right: 8px; color: #EAFBEF; }
.trend-tag { display: flex; justify-content: space-between; align-items: center; color: var(--ink); }
.trend-tag:hover { text-decoration: none; }
.trend-tag b { font-weight: 700; }
.trend-tag small { color: var(--ink-3); }
.feed-switch { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 999px; }
.feed-switch a { padding: 5px 13px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.feed-switch a:hover { text-decoration: none; color: var(--ink); }
.feed-switch a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- guest / auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: var(--green-deep); color: #E8F8EE; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side .brand { color: #fff; }
.auth-side h2 { font-size: clamp(2rem, 3.4vw, 3rem); color: #fff; line-height: 1.05; max-width: 12ch; font-weight: 700; letter-spacing: -.03em; }
.auth-side p { max-width: 42ch; opacity: .85; }
.plus-field { position: absolute; inset: 0; pointer-events: none; opacity: .5; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.7rem; }
.auth-card .sub { color: var(--ink-2); margin-bottom: 22px; }
.or-line { text-align: center; color: var(--ink-3); font-size: .85rem; margin: 16px 0; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps span { flex: 1; height: 5px; border-radius: 999px; background: var(--line); }
.steps span.on { background: var(--green); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; }
.pick span { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: .88rem; cursor: pointer; background: var(--surface); height: 100%; }
.pick input:checked + span { border-color: var(--green); background: var(--green-wash); color: var(--green-deep); }
[data-theme="dark"] .pick input:checked + span { color: var(--green-ink); }
.pick input:focus-visible + span { outline: 2px solid var(--green); }

/* ---------- landing ---------- */
.landing-nav { display: flex; justify-content: space-between; align-items: center; max-width: 1180px; margin: 0 auto; padding: 18px 22px; }
.hero { max-width: 1180px; margin: 0 auto; padding: 40px 22px 56px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: .98; letter-spacing: -.045em; font-weight: 800; margin-bottom: 20px; }
.hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 44ch; margin-bottom: 26px; }
.hero-board { position: relative; }
.hero-board .card { box-shadow: var(--shadow-pop); }
.hero-board .float-b { position: absolute; right: -8px; bottom: -26px; width: 70%; }
.plus-rain { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; margin-top: 30px; max-width: 420px; }
.plus-rain i { aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); position: relative; }
.plus-rain i.on { background: var(--green); animation: pulse 3.2s ease-in-out infinite; }
.plus-rain i.on::before, .plus-rain i.on::after { content: ""; position: absolute; background: #fff; border-radius: 2px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.plus-rain i.on::before { width: 44%; height: 12%; } .plus-rain i.on::after { width: 12%; height: 44%; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.88); } }
@media (prefers-reduced-motion: reduce) { .plus-rain i.on, .skeleton, .typing span { animation: none; } * { transition-duration: 0s !important; } }
.band { max-width: 1180px; margin: 0 auto; padding: 36px 22px; }
.band h2 { font-size: 1.7rem; margin-bottom: 18px; }
.landing-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.foot { border-top: 1px solid var(--line); padding: 26px 22px; text-align: center; color: var(--ink-3); font-size: .86rem; }
@media (max-width: 860px) { .hero, .landing-cols { grid-template-columns: 1fr; } .hero-board .float-b { position: static; width: 100%; margin-top: 12px; } }

/* ---------- admin ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { padding: 0 8px 14px; }
.admin-side .group { font-size: .74rem; font-weight: 700; color: var(--ink-3); padding: 14px 10px 4px; }
.admin-side .navlink { font-size: .92rem; padding: 8px 10px; gap: 10px; }
.admin-main { padding: 24px 28px 60px; min-width: 0; }
.admin-top { display: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 14px 16px; }
.stat .v { font: 700 1.7rem/1.1 var(--font-head); letter-spacing: -.02em; }
.stat .k { color: var(--ink-2); font-size: .84rem; margin-top: 4px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.chart-grid .card { padding: 14px 16px; }
.chart-box { position: relative; height: 240px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .78rem; color: var(--ink-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--green-wash); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.status-active, .status-published, .status-actioned, .status-verified { background: var(--green-soft); color: var(--green-ink); }
.status-suspended, .status-pending { background: var(--amber-soft); color: var(--amber); }
.status-banned, .status-removed, .status-rejected { background: var(--danger-soft); color: var(--danger); }
.status-dismissed, .status-none { background: var(--surface-2); color: var(--ink-3); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; padding: 8px 12px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form .input, .inline-form .select { padding: 6px 10px; font-size: .84rem; width: auto; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 90; transform: translateX(-100%); transition: transform .2s; }
  .admin-side.open { transform: none; box-shadow: var(--shadow-pop); }
  .admin-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 30; }
  .admin-main { padding: 16px 14px 60px; }
  .chart-grid { grid-template-columns: 1fr; }
}

/* ---------- pagination ---------- */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .88rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager .on { background: var(--green); color: #fff; border-color: var(--green); }
.pager .off { color: var(--ink-3); }

/* ---------- error pages ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-page .code { font: 800 clamp(5rem, 16vw, 9rem)/1 var(--font-head); letter-spacing: -.06em; color: var(--green); }
.error-page h1 { margin: 6px 0 8px; }
.error-page p { color: var(--ink-2); max-width: 44ch; margin: 0 auto 22px; }
