/* ===========================================================
   VR CHURCH · WIKI — searchable knowledge base.
   Public read view; "Log in with Discord" unlocks inline edit.
   Categories → entries (light markdown). One-click .md export.
   Same neon-dark HUD language as the weekend planner.
   =========================================================== */
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
:root{
  --void:#050508; --surface:#0d0d14; --lift:#14141f; --lift2:#191926; --edge:#22223a;
  --fog:#a8a8c8; --dim:#6b6b8a; --snow:#f0f0ff;
  --volt:#00cfff; --arc:#c8ff00; --gold:#ffcf4a; --blurple:#5865f2;
  --volt-glow:rgba(0,207,255,.4); --arc-glow:rgba(200,255,0,.4);
  --gold-glow:rgba(255,207,74,.4); --blurple-glow:rgba(88,101,242,.5);
}
html,body{ min-height:100%; background:var(--void); }
body{ font-family:'JetBrains Mono',monospace; color:var(--snow); -webkit-font-smoothing:antialiased;
  background:
    radial-gradient(70% 50% at 82% 4%, rgba(0,207,255,.08), transparent 60%),
    radial-gradient(60% 50% at 8% 98%, rgba(200,255,0,.04), transparent 62%),
    var(--void); }
button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
input,textarea{ font-family:inherit; }
a{ color:var(--volt); text-decoration:none; }
a:hover{ text-decoration:underline; }
.hud-dot{ width:6px; height:6px; border-radius:50%; background:currentColor; box-shadow:0 0 8px currentColor; animation:pulse 2s infinite; flex:0 0 auto; }
@keyframes pulse{ 0%,100%{opacity:1} 50%{opacity:.18} }
@media(prefers-reduced-motion:reduce){ .hud-dot{ animation:none; } }
.starfield{ position:fixed; inset:0; z-index:0; pointer-events:none; opacity:.4; }

/* ---------- TOPBAR ---------- */
.shell{ position:relative; z-index:2; }
.topbar{ position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:16px;
  height:58px; padding:0 26px; background:rgba(5,5,8,.96); border-bottom:1px solid var(--edge); }
.tb-left{ display:flex; align-items:center; gap:13px; min-width:0; }
.tb-logo{ display:flex; align-items:center; gap:9px; }
.tb-logo img{ height:24px; }
.tb-logo .wm{ font-family:'Rajdhani',sans-serif; font-weight:700; font-size:18px; letter-spacing:.09em; text-transform:uppercase; white-space:nowrap; }
.tb-logo .wm .v{ color:var(--volt); text-shadow:0 0 14px var(--volt-glow); }
.tb-back{ font-size:11px; letter-spacing:.06em; color:var(--fog); border:1px solid var(--edge); padding:7px 11px; transition:all .15s; }
.tb-back:hover{ border-color:var(--volt); color:var(--volt); }
.tb-tag{ font-size:10.5px; letter-spacing:.26em; text-transform:uppercase; color:var(--dim); padding-left:13px; border-left:1px solid var(--edge); white-space:nowrap; }
.tb-right{ display:flex; align-items:center; gap:11px; }
.role-chip{ display:flex; align-items:center; gap:8px; font-size:10.5px; letter-spacing:.08em; color:var(--fog); border:1px solid rgba(88,101,242,.5); background:rgba(88,101,242,.08); padding:8px 12px; }
.role-chip b{ color:#aab0f5; font-weight:600; }
.btn-dc{ display:flex; align-items:center; gap:9px; background:var(--blurple); color:#fff; font-weight:700; font-size:11.5px; letter-spacing:.05em; padding:10px 15px; box-shadow:0 0 22px var(--blurple-glow); transition:filter .2s, box-shadow .2s; }
.btn-dc:hover{ filter:brightness(1.08); box-shadow:0 0 32px rgba(88,101,242,.6); }
.btn-dc svg{ width:17px; height:17px; }
.btn-ghost{ display:flex; align-items:center; gap:8px; border:1px solid var(--edge); color:var(--fog); font-size:11px; letter-spacing:.08em; padding:9px 13px; transition:all .18s; }
.btn-ghost:hover{ border-color:var(--volt); color:var(--volt); }
.btn-ghost svg{ width:15px; height:15px; }
.btn-ghost.danger:hover{ border-color:#ff5a7a; color:#ff5a7a; }

/* ---------- LAYOUT ---------- */
.wrap{ max-width:1180px; margin:0 auto; padding:0 26px; }
.pagehead{ padding:40px 0 26px; border-bottom:1px solid var(--edge); }
.ph-eyebrow{ display:flex; align-items:center; gap:10px; font-size:11px; letter-spacing:.24em; text-transform:uppercase; color:var(--volt); margin-bottom:16px; }
.ph-eyebrow .ln{ width:26px; height:2px; background:var(--volt); box-shadow:0 0 8px var(--volt-glow); }
.ph-title{ font-family:'Rajdhani',sans-serif; font-weight:700; text-transform:uppercase; font-size:clamp(34px,5vw,52px); line-height:.96; letter-spacing:-.005em; }
.ph-title em{ font-style:normal; color:var(--volt); text-shadow:0 0 30px var(--volt-glow); }
.ph-sub{ color:var(--fog); font-size:13px; line-height:1.6; margin-top:14px; max-width:60ch; }

.searchbar{ display:flex; align-items:center; gap:11px; margin-top:22px; max-width:480px; border:1px solid var(--edge); background:var(--surface); padding:0 14px; transition:border-color .18s; }
.searchbar:focus-within{ border-color:var(--volt); box-shadow:0 0 20px var(--volt-glow); }
.searchbar svg{ width:16px; height:16px; color:var(--dim); flex:0 0 auto; }
.searchbar input{ flex:1; background:none; border:none; outline:none; color:var(--snow); font-size:13px; padding:14px 0; }
.searchbar input::placeholder{ color:var(--dim); }
.searchbar .clr{ color:var(--dim); font-size:11px; }
.searchbar .clr:hover{ color:var(--volt); }

.layout{ display:grid; grid-template-columns:236px 1fr; gap:38px; padding:30px 0 80px; align-items:start; }

/* ---------- SIDEBAR NAV ---------- */
.sidenav{ position:sticky; top:78px; }
.sn-label{ font-size:10px; letter-spacing:.2em; text-transform:uppercase; color:var(--dim); margin-bottom:12px; }
.sn-list{ display:flex; flex-direction:column; gap:2px; }
.sn-item{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-left:2px solid transparent; color:var(--fog); font-size:12.5px; transition:all .15s; text-align:left; width:100%; }
.sn-item:hover{ color:var(--snow); background:var(--surface); }
.sn-item.active{ border-left-color:var(--volt); color:var(--volt); background:var(--surface); }
.sn-item.draggable{ cursor:grab; }
.sn-item.draggable:active{ cursor:grabbing; }
.sn-item.dragover{ border-color:var(--volt); box-shadow:inset 0 0 0 1px var(--volt); color:var(--volt); }
.sn-grip{ display:flex; align-items:center; color:var(--dim); flex:0 0 auto; }
.sn-grip svg{ width:14px; height:14px; }
.sn-name{ flex:1; min-width:0; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sn-item .ct{ font-size:9px; letter-spacing:.06em; color:var(--dim); border:1px solid var(--edge); padding:2px 6px; flex:0 0 auto; }
.sn-export{ margin-top:18px; width:100%; display:flex; align-items:center; justify-content:center; gap:9px; padding:11px;
  border:1px solid var(--arc); background:rgba(200,255,0,.05); color:var(--arc); font-family:'Rajdhani',sans-serif;
  font-weight:700; font-size:12px; letter-spacing:.12em; text-transform:uppercase; transition:all .18s; }
.sn-export:hover{ background:rgba(200,255,0,.12); box-shadow:0 0 22px var(--arc-glow); }
.sn-export svg{ width:14px; height:14px; }
.sn-hint{ margin-top:14px; font-size:10.5px; line-height:1.6; color:var(--dim); border-top:1px solid var(--edge); padding-top:14px; }
.sn-hint b{ color:var(--fog); font-weight:500; }

/* ---------- CONTENT ---------- */
.content{ min-width:0; display:flex; flex-direction:column; gap:42px; }
.cat{ scroll-margin-top:78px; }
.cat-head{ display:flex; align-items:center; gap:13px; padding-bottom:14px; margin-bottom:20px; border-bottom:1px solid var(--edge); }
.cat-toggle{ flex:1; min-width:0; display:flex; align-items:center; gap:13px; text-align:left; background:none; }
.cat-chev{ width:16px; height:16px; color:var(--dim); flex:0 0 auto; transition:transform .2s, color .15s; }
.cat-chev.col{ transform:rotate(-90deg); }
.cat-toggle:hover .cat-chev{ color:var(--volt); }
.cat-toggle:hover .cat-title{ color:var(--volt); }
.cat-count{ font-size:11px; color:var(--dim); border:1px solid var(--edge); padding:3px 9px; flex:0 0 auto; }
.cat-head .bar{ width:4px; height:26px; background:var(--volt); box-shadow:0 0 12px var(--volt-glow); flex:0 0 auto; }
.cat-title{ font-family:'Rajdhani',sans-serif; font-weight:700; text-transform:uppercase; font-size:25px; letter-spacing:.02em; flex:1; min-width:0; }
.cat-title-inp{ flex:1; background:var(--lift); border:1px solid var(--volt); color:var(--snow); font-family:'Rajdhani',sans-serif; font-weight:700; text-transform:uppercase; font-size:23px; padding:6px 12px; outline:none; min-width:0; }
.cat-actions{ display:flex; gap:6px; flex:0 0 auto; }
.icbtn{ width:32px; height:32px; border:1px solid var(--edge); display:flex; align-items:center; justify-content:center; color:var(--dim); transition:all .15s; }
.icbtn:hover{ border-color:var(--volt); color:var(--volt); }
.icbtn.danger:hover{ border-color:#ff5a7a; color:#ff5a7a; }
.icbtn svg{ width:15px; height:15px; }
.icbtn.grip{ cursor:grab; }
.icbtn.grip:active{ cursor:grabbing; }

.entries{ display:flex; flex-direction:column; gap:13px; }
.entry{ border:1px solid var(--edge); border-left-width:2px; border-left-color:var(--edge); background:rgba(13,13,20,.5); padding:18px 20px; transition:border-color .15s, transform .12s, box-shadow .15s; }
.entry.editable{ border-left-color:var(--volt); }
.entry.dragover{ box-shadow:0 -3px 0 var(--volt); }
.entry.dragging{ opacity:.4; }
.entry-top{ display:flex; align-items:flex-start; gap:12px; }
.entry-title{ font-family:'Rajdhani',sans-serif; font-weight:700; font-size:18px; letter-spacing:.01em; color:var(--snow); flex:1; min-width:0; line-height:1.15; }
.entry-actions{ display:flex; gap:6px; flex:0 0 auto; }
.entry-body{ margin-top:11px; font-size:13px; line-height:1.72; color:var(--fog); text-wrap:pretty; }
.entry-body p{ margin:0 0 10px; }
.entry-body p:last-child{ margin-bottom:0; }
.entry-body strong{ color:var(--snow); font-weight:600; }
.entry-body em{ color:var(--snow); font-style:italic; }
.entry-body ul{ margin:0 0 10px; padding-left:4px; list-style:none; display:flex; flex-direction:column; gap:7px; }
.entry-body li{ position:relative; padding-left:18px; }
.entry-body li::before{ content:''; position:absolute; left:2px; top:9px; width:6px; height:6px; background:var(--volt); box-shadow:0 0 6px var(--volt-glow); }

/* ---------- ENTRY EDITOR ---------- */
.editor{ border:1px solid var(--volt); border-left-width:2px; background:rgba(0,207,255,.04); padding:16px 18px; box-shadow:0 0 30px rgba(0,207,255,.07); }
.ed-l{ display:block; font-size:10px; letter-spacing:.18em; text-transform:uppercase; color:var(--dim); margin-bottom:7px; }
.ed-inp{ width:100%; background:var(--lift); border:1px solid var(--edge); padding:11px 13px; font-size:14px; color:var(--snow); outline:none; transition:border-color .18s; }
.ed-inp:focus{ border-color:var(--volt); }
.ed-toolbar{ display:flex; gap:5px; margin:14px 0 0; }
.ed-tool{ width:34px; height:32px; border:1px solid var(--edge); background:var(--surface); display:flex; align-items:center; justify-content:center; color:var(--fog); transition:all .14s; }
.ed-tool:hover{ border-color:var(--volt); color:var(--volt); }
.ed-tool svg{ width:15px; height:15px; }
.ed-tool b{ font-family:'Rajdhani',sans-serif; font-weight:700; font-size:15px; }
.ed-tool i{ font-family:'Rajdhani',sans-serif; font-style:italic; font-size:15px; }
.ed-area{ width:100%; min-height:120px; resize:vertical; margin-top:7px; background:var(--lift); border:1px solid var(--edge); border-top:none; padding:12px 13px; font-size:13px; line-height:1.65; color:var(--snow); outline:none; }
.ed-area:focus{ border-color:var(--volt); }
.ed-help{ font-size:10px; color:var(--dim); margin-top:7px; }
.ed-help code{ color:var(--arc); }
.ed-actions{ display:flex; align-items:center; gap:9px; margin-top:15px; }
.ed-save{ background:var(--volt); color:#04141b; font-family:'Rajdhani',sans-serif; font-weight:700; font-size:12.5px; letter-spacing:.1em; text-transform:uppercase; padding:11px 20px; transition:box-shadow .18s,transform .18s; }
.ed-save:hover{ box-shadow:0 0 22px var(--volt-glow); transform:translateY(-1px); }
.ed-cancel{ padding:11px 16px; border:1px solid var(--edge); font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--fog); }
.ed-cancel:hover{ border-color:var(--volt); color:var(--volt); }
.ed-del{ margin-left:auto; padding:11px 14px; border:1px solid rgba(255,90,122,.4); color:#ff5a7a; font-size:11px; letter-spacing:.08em; text-transform:uppercase; }
.ed-del:hover{ background:rgba(255,90,122,.1); }

.addrow{ display:flex; gap:9px; margin-top:14px; }
.addbtn{ display:flex; align-items:center; gap:8px; padding:11px 15px; border:1px dashed var(--edge); color:var(--dim); font-size:11.5px; letter-spacing:.06em; transition:all .16s; }
.addbtn:hover{ border-color:var(--volt); color:var(--volt); border-style:solid; }
.addbtn svg{ width:14px; height:14px; }
.addcat{ width:100%; justify-content:center; padding:16px; margin-top:6px; }

.empty{ text-align:center; padding:60px 20px; color:var(--dim); }
.empty .ic{ font-size:38px; margin-bottom:14px; opacity:.5; }
.empty h3{ font-family:'Rajdhani',sans-serif; font-weight:700; font-size:20px; color:var(--fog); text-transform:uppercase; letter-spacing:.04em; }
.empty p{ font-size:12.5px; margin-top:8px; }

mark{ background:rgba(200,255,0,.22); color:var(--snow); padding:0 2px; border-radius:2px; }

/* ---------- TOAST ---------- */
.toast{ position:fixed; bottom:26px; left:50%; transform:translateX(-50%); z-index:80; display:flex; align-items:center; gap:13px;
  padding:13px 18px 13px 14px; background:#1e2128; border:1px solid rgba(88,101,242,.5); min-width:300px;
  box-shadow:0 18px 50px rgba(0,0,0,.6); animation:rise .3s cubic-bezier(.2,.7,.2,1); }
@keyframes rise{ from{opacity:0; transform:translate(-50%,14px)} to{opacity:1; transform:translate(-50%,0)} }
.toast .ic{ width:34px; height:34px; border-radius:50%; background:var(--blurple); display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.toast.ok .ic{ background:var(--arc); }
.toast .ic svg{ width:19px; height:19px; color:#fff; }
.toast.ok .ic svg{ color:#0c1a00; }
.toast .tx{ font-size:12.5px; line-height:1.35; color:var(--snow); }
.toast .tx b{ color:#aab0f5; font-weight:600; }
.toast.ok .tx b{ color:var(--arc); }

/* ---------- responsive ---------- */
@media(max-width:860px){
  .layout{ grid-template-columns:1fr; gap:24px; }
  .sidenav{ position:static; }
  .sn-list{ flex-direction:row; flex-wrap:wrap; gap:7px; }
  .sn-item{ width:auto; border-left:none; border:1px solid var(--edge); padding:9px 13px; }
  .sn-item.active{ border-color:var(--volt); }
  .sn-export{ margin-top:14px; }
  .sn-hint{ display:none; }
}
@media(max-width:600px){
  body{ font-size:15px; }
  .topbar{ padding:0 16px; gap:10px; }
  .tb-tag{ display:none; }
  .btn-dc span.lbl{ display:none; }
  .role-chip{ display:none; }
  .wrap{ padding:0 16px; }
  .entry{ padding:15px 16px; }
}
