﻿/* ------------------------------------------------------------------ design tokens */
:root {
  color-scheme: dark;
  --bg:       #0a0a0a;
  --bg-2:     #141414;
  --panel:    rgba(20, 20, 20, .82);
  --panel-2:  rgba(32, 32, 32, .9);
  --panel-solid: #151515;
  --panel-2-solid: #202020;
  --line:     rgba(245, 245, 245, .09);
  --line-strong: rgba(245, 245, 245, .17);
  --text:     #f3f3f3;
  --muted:    #a5a5a5;
  /* the one accent: matches the client menu's focus/open-page blue (#4F8EF7, see
     src/render/menu/imgui_theme.hpp). Used for links, focus rings, selected tabs,
     unread notifications and the primary call-to-action; never a fill behind text. */
  --accent:   #4F8EF7;
  --accent-2: #78a7f9;
  --accent-glow: rgba(79, 142, 247, .18);
  --good:     #cfcfcf;
  --warn:     #cdcdcd;
  --bad:      #a1a1a1;
  --chip-1:   #444444;
  --chip-2:   #202020;
  /* Current local image for the crossfading background in /assets/bg.js. */
  --page-bg:  url("/assets/backgrounds/bg-1.jpg");
  --radius:   12px;
  --radius-lg: 18px;
  --shadow:   0 2px 6px rgba(0, 0, 0,.28), 0 12px 32px rgba(0, 0, 0,.28);
  --shadow-lg:0 4px 12px rgba(0, 0, 0,.36), 0 28px 70px rgba(0, 0, 0,.42);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-feature-settings: "ss01", "cv11";
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); min-height: 100%; }

/* Background images live in two crossfading fixed layers inserted by /assets/bg.js. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  background-color: var(--bg);
  overflow-x: hidden;
}
.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg);
  background-image: var(--page-bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.site-backdrop.is-layered { background-image: none; }
.site-backdrop__image {
  position: absolute;
  inset: -1.5%;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 1s ease;
  will-change: opacity;
}
.site-backdrop__image.is-visible { opacity: 1; }
.site-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(900px 560px at 8% -10%, rgba(79, 142, 247,.14), transparent 62%),
    radial-gradient(1000px 700px at 100% 14%, rgba(95, 95, 95,.15), transparent 58%),
    linear-gradient(180deg, rgba(10, 10, 10,.84) 0%, rgba(10, 10, 10,.76) 45%, rgba(10, 10, 10,.96) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .site-backdrop__image { transition-duration: .18s; }
}

button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
a { color: var(--accent); }
p { margin: 0; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.multiline { white-space: pre-wrap; word-break: break-word; }
.noscript { padding: 24px; }
::selection { background: rgba(255, 255, 255, .22); color: var(--bg); }

/* ------------------------------------------------------------------ layout */
main { flex: 1 0 auto; display: flex; flex-direction: column; }
.center { flex: 1; display: grid; place-items: center; padding: 36px 20px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.pad { padding: 30px; }
.form { width: 380px; max-width: 100%; display: grid; gap: 18px; }
.row-between { justify-content: space-between; }
.section-label {
  text-transform: uppercase; letter-spacing: .08em; font-size: 11px;
  color: var(--muted); font-weight: 700; margin: 6px 0 0;
  display: flex; align-items: center; gap: 12px;
}
.section-label i { font-size: 11px; width: 16px; text-align: center; }

/* ------------------------------------------------------------------ hero (form pages)
   container for the brand badge above forms; the SVG child carries its own rounded tile and
   dark fill, so the container is just a flex-centering wrapper with a soft drop shadow. */
.hero-icon {
  display: grid; place-items: center; margin: 0 auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .55));
}
.hero-icon svg { display: block; }
.hero-icon i { font-size: 30px; color: #ffffff; }

/* Visually hidden labels for assistive technology. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ------------------------------------------------------------------ profile card */
.profile-card { display: flex; align-items: center; gap: 20px; }
.profile-info { display: grid; gap: 4px; }
.profile-info .name { font-size: 20px; font-weight: 700; }
.profile-rows { display: grid; gap: 16px; margin-top: 6px; }
.section-label + .profile-rows { margin-top: 16px; }
.profile-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.profile-row i { width: 16px; text-align: center; color: var(--muted); }
.profile-row .val { color: var(--text); font-weight: 500; }
.profile-row .lbl { color: var(--muted); }

/* ------------------------------------------------------------------ form controls */
input[type=text], input[type=password], input[type=number], select, textarea {
  background: rgba(10, 10, 10, .65);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
textarea { resize: none; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: rgba(10, 10, 10, .85);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
label.field { display: grid; gap: 5px; }
label.field > span { color: var(--muted); font-size: 12px; }
.btn {
  background: rgba(30, 30, 30, .7); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 16px; cursor: pointer; white-space: nowrap; text-decoration: none;
  color: var(--text); display: inline-block; text-align: center; font-weight: 500;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .08s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover { border-color: var(--line-strong); background: rgba(40, 40, 40,.8); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0,.3); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn.primary {
  background: linear-gradient(180deg, #5f98f8, #3e7ef2);
  border-color: #3e7ef2; color: #ffffff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 142, 247,.26), 0 4px 16px rgba(0, 0, 0,.4);
}
.btn.primary:hover { background: linear-gradient(180deg, #78a7f9, #4F8EF7); box-shadow: 0 2px 10px rgba(79, 142, 247,.36), 0 6px 20px rgba(0, 0, 0,.45); }
.btn.danger { border-color: rgba(255, 255, 255,.22); color: var(--bad); font-weight: 600; }
.btn.danger:hover { background: rgba(50, 50, 50,.8); }
.btn.small { padding: 6px 13px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center-x { justify-content: center; }
.error { color: var(--bad); font-weight: 600; min-height: 1.2em; }
.notice { color: var(--good); min-height: 1.2em; }
.error:empty, .notice:empty { display: none; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ------------------------------------------------------------------ account page */
.account-wrap { max-width: 1100px; }
.account-header { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: 24px 28px; }
.account-identity { display: grid; gap: 6px; min-width: 0; }
.account-identity .name { font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
.account-identity .small { font-size: 13px; color: var(--muted); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.account-meta { display: grid; gap: 14px; min-width: 170px; text-align: right; align-self: center; }
.account-meta > div { display: grid; gap: 3px; }
.account-meta .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.account-meta .val { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.account-col { display: grid; gap: 20px; align-content: start; min-width: 0; }
.account-panel { display: flex; flex-direction: column; gap: 14px; padding: 24px 26px; min-width: 0; }
.account-panel .section-label { margin: 0; }
.account-panel .section-label + .muted.small { margin-top: -8px; }
.account-panel .muted.small { margin: 0; font-size: 12.5px; line-height: 1.5; }
.account-panel > .btn { align-self: flex-start; }
.account-form { display: flex; flex-direction: column; gap: 14px; }
.account-form .btn.primary { align-self: flex-start; }
.account-form .field { display: grid; gap: 6px; }
.account-form .field > span { color: var(--muted); font-size: 12px; }
.account-panel .list .list-row { padding: 14px 16px; }
.account-panel .list .list-row-icon { width: 34px; height: 34px; font-size: 13px; }
.account-panel .list .list-row-main .badge { margin-left: 8px; }
.account-panel .list .list-empty { padding: 20px; }
.mono { font-family: "JetBrains Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace; }

/* ------------------------------------------------------------------ invite codes */
.invite-list { display: flex; flex-direction: column; gap: 8px; }
.invite-list .list-empty { padding: 4px 0; text-align: left; color: var(--muted); font-size: 13px; }
.invite-row { background: rgba(10, 10, 10,.55); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.invite-row.invite-used, .invite-row.invite-expired, .invite-row.invite-revoked { opacity: .55; }
.invite-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.invite-code { font-family: "JetBrains Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace; font-size: 13px; font-weight: 600; letter-spacing: .03em; word-break: break-all; color: var(--text); }
.invite-meta { font-size: 12px; color: var(--muted); }
.invite-row .badge { margin: 0; flex: 0 0 auto; }
.invite-row .btn { flex: 0 0 auto; padding: 5px 12px; font-size: 12px; }

@media (max-width: 900px) {
  .account-header { grid-template-columns: auto 1fr; padding: 18px; gap: 18px; }
  .account-meta { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; text-align: left; gap: 10px; align-self: auto; }
  .account-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ forum / list rows */
.wrap { max-width: 940px; margin: 0 auto; padding: 36px 20px 64px; display: grid; gap: 22px; width: 100%; }
.page-title { display: flex; align-items: center; gap: 14px; }
.page-title i {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--chip-1), var(--chip-2));
  color: #ffffff; font-size: 18px; flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(0, 0, 0,.4);
}
.crumbs { color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

.list {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.list-row {
  background: var(--panel); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: background .12s ease, transform .12s ease;
}
.list-row:hover { background: var(--panel-2); }
.list-row-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(30, 30, 30,.75); color: var(--accent);
  display: grid; place-items: center; font-size: 15px; flex: 0 0 auto;
  transition: background .12s ease, color .12s ease;
}
.list-row:hover .list-row-icon { background: rgba(10, 10, 10,.75); color: #ffffff; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-main a { color: var(--text); text-decoration: none; font-weight: 600; }
.list-row-main a:hover { color: var(--accent); }
.list-row-desc { color: var(--muted); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.list-row > .btn { flex: 0 0 auto; }
.list-row-stats { color: var(--muted); font-size: 12px; text-align: right; min-width: 90px; }
.list-row-stats strong { color: var(--text); font-size: 14px; display: block; margin-bottom: 2px; }
.list-empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.list-empty i { display: block; font-size: 24px; margin-bottom: 12px; opacity: .5; }

.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 5px; margin-left: 8px; vertical-align: middle;
  background: rgba(35, 35, 35,.9); color: var(--muted); border: 1px solid var(--line-strong);
}
.badge.sticky, .badge.ok { color: var(--good); }
.badge.locked, .badge.expired { color: var(--warn); }
.badge.staff { color: var(--accent); }
.badge.used { color: var(--muted); }
.badge.revoked { color: var(--bad); }

.post-list { display: grid; gap: 14px; }
.post { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; display: flex; gap: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.post-main { flex: 1; min-width: 0; display: grid; gap: 12px; }
.post-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.post-author-group { display: flex; align-items: center; gap: 8px; }
.post-author { font-weight: 600; color: var(--text); text-decoration: none; }
.post-author:hover { color: var(--accent); text-decoration: underline; }
.post-meta { color: var(--muted); }
.post-body { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.post-body.deleted { color: var(--muted); font-style: italic; }
.post-actions { display: flex; gap: 8px; justify-content: flex-end; }
.post-actions .btn { padding: 5px 12px; font-size: 12px; }
.post-actions .like-btn { margin-right: auto; }
.post-actions .like-btn.active { color: var(--accent); border-color: var(--accent-2); }
.post-actions .like-btn.active:hover { color: var(--accent); }

.bb-mention { font-weight: 600; text-decoration: none; }
.bb-mention:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ members directory */
.member-row { text-decoration: none; color: inherit; cursor: pointer; }
.member-name { font-weight: 600; color: var(--text); }

/* ------------------------------------------------------------------ BBCode */
.bb-u { text-decoration: underline; }
.bb-code {
  background: rgba(10, 10, 10,.75); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 4px 0;
  overflow-x: auto; font-size: 12.5px; white-space: pre;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}
.bb-quote { background: rgba(30, 30, 30,.65); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 4px 0; }
.bb-quote-who { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.bb-list { margin: 4px 0; padding-left: 22px; display: grid; gap: 4px; }

.bb-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
label.field > .bb-toolbar { margin-bottom: 1px; }
.bb-toolbar-btn { background: rgba(10, 10, 10,.55); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; color: var(--muted); cursor: pointer; font-size: 12px; transition: color .12s ease, background .12s ease; }
.bb-toolbar-btn:hover { color: var(--text); background: rgba(30, 30, 30,.9); }

@media (max-width: 480px) {
  .form { width: 100%; }
  .pad { padding: 20px; }
  .wrap { padding: 22px 14px 48px; gap: 16px; }
  .list-row-icon { display: none; }
  .list-row { flex-wrap: wrap; padding: 14px 16px; }
  .list-row-stats { text-align: left; }
  .post { padding: 16px; }
}

.secret-key { display: block; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(30, 30, 30,.7); word-break: break-all; user-select: all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 12px 0; }
.recovery-codes code { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(30, 30, 30,.7); text-align: center; }
@media (max-width: 480px) { .recovery-codes { grid-template-columns: 1fr; } }

.changelog-wrap { max-width: 780px; }
.changelog-list { display: grid; gap: 14px; margin-top: 18px; }
.changelog-entry .section-label .badge { margin-left: 10px; }
.changelog-notes { white-space: pre-line; line-height: 1.55; margin-top: 10px; }

.faq-wrap { max-width: 780px; }
.faq-list { display: grid; gap: 10px; margin-top: 18px; }
.faq-item { padding: 16px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 10px 0 0; color: var(--muted); line-height: 1.6; }

[hidden] { display: none !important; }

.twofactor-qr { display: block; width: 200px; height: 200px; margin: 12px auto; padding: 8px; background: #ffffff; border-radius: var(--radius); image-rendering: pixelated; }

/* ------------------------------------------------------------------ page transitions */
@media (prefers-reduced-motion: no-preference) {
  main { animation: pageFadeIn .35s ease; }
  @keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ------------------------------------------------------------------ refreshed shared visual system */
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { line-height: 1.55; }
h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.045em; line-height: 1.08; }
h2 { letter-spacing: -.035em; }
a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

.panel {
  background: linear-gradient(145deg, rgba(29, 29, 29,.9), rgba(16, 16, 16,.88));
  border-color: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.wrap { max-width: 1120px; padding-top: 42px; gap: 26px; }
.page-title { gap: 18px; }
.page-title i {
  width: 54px; height: 54px; border-radius: 17px;
  color: var(--accent); font-size: 20px;
  background: linear-gradient(145deg, rgba(161, 161, 161,.2), rgba(45, 45, 45,.82));
  border: 1px solid rgba(224, 224, 224,.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0,.3), inset 0 1px rgba(255, 255, 255,.06);
}
.section-label { color: #bfbfbf; }

input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  min-height: 42px; color: var(--text);
  background: rgba(10, 10, 10,.72); border-color: rgba(245, 245, 245,.11); border-radius: 11px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); background: rgba(12, 12, 12,.92);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.btn {
  min-height: 40px; padding: 9px 16px; border-radius: 11px;
  background: linear-gradient(180deg, rgba(44, 44, 44,.88), rgba(28, 28, 28,.92));
  border-color: var(--line-strong); box-shadow: 0 3px 10px rgba(0, 0, 0,.18);
}
.btn:hover { background: linear-gradient(180deg, rgba(60, 60, 60,.96), rgba(36, 36, 36,.96)); border-color: rgba(224, 224, 224,.34); }
.btn.primary {
  color: #ffffff; border-color: #3e7ef2;
  background: linear-gradient(180deg, #5f98f8, #3e7ef2);
  box-shadow: 0 6px 18px rgba(79, 142, 247,.28), inset 0 1px rgba(255, 255, 255,.18);
}
.btn.primary:hover { background: linear-gradient(180deg, #78a7f9, #4F8EF7); box-shadow: 0 8px 22px rgba(79, 142, 247,.34); }
.btn.danger { color: #b1b1b1; border-color: rgba(161, 161, 161,.25); }
.btn.danger:hover { background: rgba(47, 47, 47,.48); border-color: rgba(161, 161, 161,.48); }
.error { color: var(--bad); }
.notice { color: var(--good); }

.list { gap: 9px; background: transparent; border: 0; overflow: visible; backdrop-filter: none; }
.list-row {
  min-height: 68px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(130deg, rgba(26, 26, 26,.88), rgba(17, 17, 17,.91));
  box-shadow: 0 4px 14px rgba(0, 0, 0,.14);
}
.list-row:hover { background: linear-gradient(130deg, rgba(39, 39, 39,.96), rgba(23, 23, 23,.96)); border-color: rgba(224, 224, 224,.2); }
.post { border-color: var(--line); background: linear-gradient(145deg, rgba(26, 26, 26,.9), rgba(16, 16, 16,.9)); }
.badge { border-radius: 999px; padding: 4px 9px; font-size: 10px; }
.badge.ok { color: #d7d7d7; border-color: rgba(207, 207, 207,.2); background: rgba(86, 86, 86,.2); }
.badge.locked, .badge.expired { color: #b2b2b2; border-color: rgba(161, 161, 161,.2); background: rgba(52, 52, 52,.2); }
.badge.staff { color: var(--accent); border-color: rgba(224, 224, 224,.2); background: rgba(108, 108, 108,.18); }
.account-header, .account-panel { border-color: var(--line); }
.account-panel { background: linear-gradient(145deg, rgba(28, 28, 28,.94), rgba(17, 17, 17,.94)); }
.profile-card { align-items: center; }
.faq-item, .changelog-entry { transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.faq-item:hover, .changelog-entry:hover { border-color: rgba(224, 224, 224,.18); transform: translateY(-1px); }

/* ------------------------------------------------------------------ centered home */
/* Keep the home page scrollable on short screens, but avoid a scrollbar flashing in and out
   while the shared nav and signed-in content finish measuring during refresh. */
.home-document { scrollbar-width: none; }
.home-document::-webkit-scrollbar { display: none; }
.home-page { min-height: 100svh; height: auto; overflow-y: auto; }
.home-page main { flex: 1 0 auto; width: 100%; display: grid; place-items: center; padding: 30px 18px; }
.hub {
  width: min(100%, 600px); margin: auto;
  padding: clamp(30px, 6vh, 58px) clamp(22px, 5vw, 54px);
  display: grid; gap: clamp(26px, 4vh, 38px); justify-items: center;
  text-align: center;
}
.hub-head { display: grid; justify-items: center; gap: 14px; max-width: 500px; }
.hub-mark {
  width: 72px; height: 72px; border-radius: 20px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(79, 142, 247,.22), rgba(28, 28, 32,.9));
  border: 1px solid rgba(79, 142, 247,.3);
  box-shadow: 0 10px 28px rgba(0, 0, 0,.45), inset 0 1px rgba(255, 255, 255,.08);
}
.hub-mark svg { width: 44px; height: 44px; display: block; }
.hub-head h1 { font-size: clamp(28px, 4.4vw, 40px); letter-spacing: -.035em; margin: 0; }
.hub-head p { color: var(--muted); font-size: 15px; max-width: 420px; }
.hub-status {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 5px;
}
.hub-status[hidden] { display: none; }
.hub-build-link { color: var(--muted); font-size: 14px; text-decoration: none; transition: color .15s ease; }
.hub-build-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.hub-build-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hub-actions .btn { min-width: 150px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 560px) {
  .home-page main { padding: 22px 14px; }
  .hub { gap: 26px; border-radius: 18px; }
  .hub-mark { width: 60px; height: 60px; border-radius: 16px; }
  .hub-mark svg { width: 36px; height: 36px; }
  .hub-actions { width: 100%; flex-direction: column; }
  .hub-actions .btn { width: 100%; }
}
main[hidden] { display: none !important; }
.forum-card-link { color: inherit; text-decoration: none; cursor: pointer; }
.forum-card-link .forum-link-title, .forum-node-row .forum-node-title { color: var(--text); font-weight: 600; }
.forum-card-link:hover .forum-link-title, .forum-node-row:hover .forum-node-title { color: var(--accent); }
.forum-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.forum-node-row .badge { margin-left: 8px; }

/* Member directory: private until session verification, then a responsive card grid. */
.directory-page { flex: 1; width: 100%; }
.directory-wrap { max-width: 1120px; gap: 22px; }
.directory-heading { display: flex; align-items: center; gap: 18px; padding: 18px 2px 6px; }
.directory-heading-icon {
  width: 64px; height: 64px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1px solid rgba(224, 224, 224,.22); border-radius: 20px;
  color: var(--accent); font-size: 23px;
  background: radial-gradient(circle at 30% 20%, rgba(224, 224, 224,.2), transparent 65%), linear-gradient(145deg,#272727,#171717);
  box-shadow: 0 12px 28px rgba(0, 0, 0,.3), inset 0 1px rgba(255, 255, 255,.06);
}
.directory-heading h1 { margin: 3px 0 5px; }
.directory-heading .muted { font-size: 14px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.directory-count { margin-left: auto; padding: 8px 12px; color: #d0d0d0; font-size: 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(23, 23, 23,.75); }
.directory-toolbar { display: flex; align-items: center; gap: 16px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(17, 17, 17,.78); box-shadow: inset 0 1px rgba(255, 255, 255,.035); }
.directory-search { flex: 1; min-width: 0; }
.directory-search-box { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px 0 12px; border: 1px solid rgba(245, 245, 245,.1); border-radius: 11px; background: rgba(9, 9, 9,.68); color: var(--muted); transition: border-color .16s ease, box-shadow .16s ease; }
.directory-search-box:focus-within { border-color: rgba(224, 224, 224,.55); box-shadow: 0 0 0 3px rgba(224, 224, 224,.1); }
.directory-search-box > i { color: var(--accent); font-size: 13px; }
.directory-search-box input { flex: 1; min-width: 0; min-height: 42px; padding: 0 8px 0 0; border: 0; outline: 0; background: transparent; box-shadow: none; }
.directory-search-box input:focus { background: transparent; box-shadow: none; }
.directory-search-box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.directory-search-clear { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.directory-search-clear:hover { color: var(--text); background: rgba(255,255,255,.08); }
.directory-search-clear[hidden] { display: none; }
.directory-status { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.member-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-height: 72px; }
.member-card { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 16px; color: inherit; text-decoration: none; background: linear-gradient(145deg, rgba(27, 27, 27,.94), rgba(16, 16, 16,.94)); box-shadow: 0 6px 18px rgba(0, 0, 0,.17); transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.member-card:hover { transform: translateY(-3px); border-color: rgba(224, 224, 224,.32); background: linear-gradient(145deg, rgba(40, 40, 40,.98), rgba(21, 21, 21,.98)); box-shadow: 0 14px 28px rgba(0, 0, 0,.26), 0 0 24px rgba(169, 169, 169,.06); }
.member-card .avatar { width: 48px; height: 48px; font-size: 16px; border: 1px solid rgba(245, 245, 245,.13); box-shadow: 0 5px 14px rgba(0, 0, 0,.24); }
.member-card-main { flex: 1; min-width: 0; }
.member-card-name { display: flex; align-items: center; gap: 5px; min-width: 0; flex-wrap: wrap; font-weight: 700; letter-spacing: -.01em; }
.member-card-name-text { overflow: hidden; text-overflow: ellipsis; }
.member-card-name .badge { margin: 0; }
.member-card-meta { margin-top: 5px; color: var(--muted); font-size: 11.5px; }
.member-card-arrow { color: #6d6d6d; font-size: 12px; transition: color .16s ease, transform .16s ease; }
.member-card:hover .member-card-arrow { color: var(--accent); transform: translateX(3px); }
.member-skeleton { display: flex; align-items: center; gap: 13px; min-height: 80px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(21, 21, 21,.78); }
.skeleton-avatar, .skeleton-copy i { display: block; position: relative; overflow: hidden; background: rgba(245, 245, 245,.07); }
.skeleton-avatar { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; }
.skeleton-copy { display: grid; flex: 1; gap: 9px; }
.skeleton-copy i { height: 10px; max-width: 140px; border-radius: 999px; }
.skeleton-copy i + i { max-width: 90px; height: 7px; }
.skeleton-avatar::after, .skeleton-copy i::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(245, 245, 245,.09), transparent); animation: skeletonShimmer 1.4s infinite; }
@keyframes skeletonShimmer { to { transform: translateX(100%); } }
.directory-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 48px 20px; color: var(--muted); text-align: center; }
.directory-empty i { margin-bottom: 4px; color: var(--accent); font-size: 24px; }
.directory-empty strong { color: var(--text); font-size: 16px; }
.directory-more { display: flex; justify-content: center; min-height: 42px; }
.directory-more .btn { display: inline-flex; align-items: center; gap: 10px; }
.directory-more .btn i { color: var(--accent); font-size: 12px; }
.member-grid[aria-busy="true"] { opacity: .72; }

@media (max-width: 900px) {
  .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-wrap { padding-top: 32px; }
}
@media (max-width: 600px) {
  .wrap { padding-top: 28px; }
  .directory-heading { gap: 13px; }
  .directory-heading-icon { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }
  .directory-heading .muted { font-size: 12px; }
  .directory-count { display: none; }
  .directory-toolbar { display: grid; gap: 9px; padding: 11px; }
  .directory-status { padding-left: 2px; }
  .member-grid { grid-template-columns: 1fr; gap: 9px; }
  .member-card { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
