/* ============================================================
   DEEP HOLLER ORGANIZATION - LAYOUT CSS
   Colors from deepholler_logo.png
   Matte Black #0E0E0F | Graphite #1C1D20 | Gunmetal #34373C
   Steel Silver #B8B8B2 | Warm Gold #C89B58 | Crimson #8F1B1B
   ============================================================ */

:root {
  --sidebar-width: 48px;
  --rail-width: 48px;
  --flyout-width: 240px;
  --right-panel-width: 260px;
  --topbar-height: 52px;
  --userbar-height: 52px;
}

body { overflow: hidden; height: 100vh; display: flex; flex-direction: column; }
#grain { position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: 0.035; background-image: url('data:image/svg+xml,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.85%22 numOctaves=%224%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22/%3E%3C/svg%3E'); }
#app-shell { display: flex; flex: 1; height: calc(100vh - var(--userbar-height) - 28px); overflow: hidden; position: relative; }

/* MARQUEE */
#marquee-bar { height: 28px; background: #0E0E0F; border-bottom: 1px solid rgba(200,155,88,.2); overflow: hidden; position: relative; z-index: 200; flex-shrink: 0; }
#marquee-track { display: inline-flex; align-items: center; white-space: nowrap; animation: marqueeScroll 120s linear infinite; height: 100%; padding-left: 100%; }
#marquee-track:hover { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: 6px; padding: 0 20px; }
.marquee-icon { font-size: 11px; }
.marquee-text { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; letter-spacing: 1.5px; color: #5A3B2A; text-transform: uppercase; font-weight: 600; }
.marquee-sep { color: rgba(143,27,27,.4); font-size: 9px; padding: 0 6px; }
@keyframes marqueeScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes notifPanelIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* SIDEBAR - ICON RAIL */
#sidebar { width: var(--rail-width); min-width: var(--rail-width); height: 100%; position: relative; z-index: 100; flex-shrink: 0; }
#nav-rail { width: var(--rail-width); height: 100%; background: #1C1D20; border-right: 1px solid rgba(200,155,88,.15); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 3px; overflow: hidden; position: relative; z-index: 102; }

#hamburger-btn { width: 36px; height: 36px; background: none; border: 1px solid rgba(200,155,88,.2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; margin-bottom: 8px; border-radius: 3px; transition: all .15s; flex-shrink: 0; }
#hamburger-btn:hover { background: rgba(200,155,88,.1); border-color: #C89B58; }
#hamburger-btn.active { background: rgba(200,155,88,.15); border-color: #C89B58; }
#hamburger-btn.active .hb-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#hamburger-btn.active .hb-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
#hamburger-btn.active .hb-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.hb-line { width: 16px; height: 2px; background: #5A3B2A; border-radius: 2px; transition: all .2s ease; transform-origin: center; display: block; }

.rail-btn { width: 36px; height: 36px; background: none; border: none; color: #5A3B2A; font-size: 15px; cursor: pointer; border-radius: 3px; transition: all .15s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.rail-btn:hover { background: rgba(200,155,88,.1); color: #C89B58; }
.rail-btn.active { background: rgba(200,155,88,.15); color: #C89B58; }
.rail-btn.active::before { content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 2px; background: #C89B58; border-radius: 0 2px 2px 0; }

/* FLYOUT */
#nav-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.75); z-index: 500; }
#nav-overlay.visible { display: block; }
#nav-flyout { position: fixed; top: 0; bottom: 0; left: var(--rail-width); width: var(--flyout-width); background: #1C1D20; border-right: 1px solid rgba(200,155,88,.15); z-index: 501; display: none; flex-direction: column; }
#nav-flyout.open { display: flex; }

#flyout-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px; border-bottom: 1px solid rgba(200,155,88,.1); flex-shrink: 0; min-height: var(--topbar-height); }
.flyout-logo-name { font-family: 'Bebas Neue', sans-serif; font-size: 15px; color: #D2D0CB; letter-spacing: 3px; }
.flyout-logo-sub { font-family: 'Share Tech Mono', monospace; font-size: 8px; color: #C89B58; letter-spacing: 2px; margin-top: 2px; }
#flyout-close-btn { background: none; border: none; color: #5A3B2A; font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 3px; transition: all .15s; line-height: 1; }
#flyout-close-btn:hover { color: #C89B58; background: rgba(200,155,88,.08); }

#flyout-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px; scrollbar-width: thin; scrollbar-color: #34373C transparent; }
#flyout-nav::-webkit-scrollbar { width: 3px; }
#flyout-nav::-webkit-scrollbar-thumb { background: #34373C; border-radius: 2px; }
#flyout-footer { padding: 8px; border-top: 1px solid #232428; flex-shrink: 0; }

.flyout-section-label { font-family: 'Share Tech Mono', monospace; font-size: 8px; letter-spacing: 3px; color: #34373C; text-transform: uppercase; padding: 10px 8px 4px; }
.flyout-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; padding: 8px 10px; border-radius: 3px; cursor: pointer; text-align: left; transition: background .12s; border-left: 2px solid transparent; }
.flyout-item:hover { background: rgba(200,155,88,.06); }
.flyout-item.active { background: rgba(200,155,88,.1); border-left-color: #C89B58; }
.fi-icon { font-size: 13px; color: #5A3B2A; width: 18px; text-align: center; flex-shrink: 0; transition: color .12s; }
.fi-label { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 1px; color: #5A3B2A; text-transform: uppercase; white-space: nowrap; transition: color .12s; font-weight: 600; }
.flyout-item:hover .fi-icon, .flyout-item:hover .fi-label { color: #B8B8B2; }
.flyout-item.active .fi-icon { color: #C89B58; }
.flyout-item.active .fi-label { color: #D2D0CB; }
.flyout-logout .fi-icon, .flyout-logout .fi-label { color: #34373C; }
.flyout-logout:hover { background: rgba(143,27,27,.08) !important; }
.flyout-logout:hover .fi-icon, .flyout-logout:hover .fi-label { color: #8F1B1B !important; }
#sidebar-overlay { display: none; }

/* CENTER COLUMN */
#center-column { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
#topbar { height: var(--topbar-height); min-height: var(--topbar-height); background: rgba(28,29,32,.98); border-bottom: 1px solid rgba(200,155,88,.15); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 12px; flex-shrink: 0; position: relative; z-index: 50; backdrop-filter: blur(8px); }
#topbar-left { display: flex; align-items: center; gap: 12px; }
#topbar-right { display: flex; align-items: center; gap: 8px; }
#mobile-menu-btn { display: none; background: none; border: 1px solid rgba(200,155,88,.25); color: #B8B8B2; font-size: 16px; padding: 4px 9px; cursor: pointer; transition: all .2s; border-radius: 2px; }
#mobile-menu-btn:hover { border-color: #C89B58; color: #D2D0CB; }
#topbar-page-name { display: flex; align-items: center; gap: 8px; }
#topbar-icon { font-size: 16px; color: #C89B58; }
#topbar-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 3px; color: #D2D0CB; text-transform: uppercase; }
#topbar-right-toggle { background: none; border: 1px solid #34373C; color: #5A3B2A; font-size: 16px; padding: 4px 8px; cursor: pointer; transition: all .2s; border-radius: 2px; }
#topbar-right-toggle:hover { border-color: rgba(200,155,88,.3); color: #B8B8B2; }
#topbar-right-toggle.active { border-color: rgba(200,155,88,.4); color: #C89B58; }
#topbar-notif-btn { background: none; border: 1px solid #232428; color: #5A3B2A; font-size: 14px; padding: 4px 9px; cursor: pointer; transition: all .2s; border-radius: 2px; position: relative; }
#topbar-notif-btn.active { border-color: rgba(200,155,88,.5) !important; color: #C89B58 !important; }
#topbar-notif-btn:hover { border-color: rgba(200,155,88,.3); color: #C89B58; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: #8F1B1B; color: #D2D0CB; font-family: 'Share Tech Mono', monospace; font-size: 8px; padding: 1px 4px; border-radius: 8px; min-width: 16px; text-align: center; line-height: 1.4; }

#main-content { flex: 1; overflow-y: auto; overflow-x: hidden; background: #0E0E0F; position: relative; transition: opacity .18s ease, transform .18s ease; scrollbar-width: thin; scrollbar-color: #C89B58 #1C1D20; }
#main-content::-webkit-scrollbar { width: 5px; }
#main-content::-webkit-scrollbar-track { background: #1C1D20; }
#main-content::-webkit-scrollbar-thumb { background: #5A3B2A; border-radius: 3px; }

/* RIGHT PANEL */
#right-panel { width: var(--right-panel-width); min-width: var(--right-panel-width); height: 100%; background: #1C1D20; border-left: 1px solid rgba(200,155,88,.1); overflow: hidden; flex-shrink: 0; display: flex; flex-direction: column; }
#right-panel-inner { width: 100%; flex: 1 1 0; min-height: 0; max-height: 100%; overflow-y: auto; overflow-x: hidden; padding: 12px 0 40px; scrollbar-width: none; }
#right-panel-inner::-webkit-scrollbar { display: none; }

/* MORTICIA */
#rp-morticia { flex-shrink: 0; flex-basis: auto; position: relative; border-top: 1px solid rgba(200,155,88,.12); cursor: pointer; overflow: hidden; }
#rp-morticia:hover #rp-morticia-av img { filter: brightness(0.95) contrast(1.15) saturate(0.9); }
#rp-morticia-av { width: 100%; height: 160px; position: relative; overflow: hidden; background: #0E0E0F; }
#rp-morticia-av img { width: 100%; height: 320px; object-fit: cover; object-position: center 30%; display: block; filter: brightness(0.75) contrast(1.1) saturate(0.85); transition: filter 0.3s ease; }
#rp-morticia-av::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg,transparent 0%,transparent 40%,rgba(14,14,15,0.6) 70%,rgba(28,29,32,0.98) 100%); pointer-events: none; }
#rp-morticia-av canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
#rp-morticia-label { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px 12px 8px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
#rp-morticia-status { width: 6px; height: 6px; border-radius: 50%; background: #2abaaa; box-shadow: 0 0 6px #2abaaa; display: inline-block; margin-bottom: 2px; }
#rp-morticia-name { font-family: 'Bebas Neue', sans-serif; font-size: 13px; color: #D2D0CB; letter-spacing: 2px; display: block; }
#rp-morticia-title { font-family: 'Share Tech Mono', monospace; font-size: 7px; color: #2abaaa; letter-spacing: 2px; text-transform: uppercase; display: block; }

.rp-section { padding: 16px 14px; }
.rp-section-label { font-family: 'Share Tech Mono', monospace; font-size: 8px; letter-spacing: 3px; color: #5A3B2A; text-transform: uppercase; margin-bottom: 12px; }
.rp-divider { height: 1px; background: rgba(200,155,88,.08); margin: 4px 0; }
.rp-loading { font-family: 'Share Tech Mono', monospace; font-size: 10px; letter-spacing: 2px; color: #34373C; text-transform: uppercase; padding: 8px 0; }
.rp-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #232428; }
.rp-stat-row:last-child { border-bottom: none; }
.rp-stat-label { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; letter-spacing: 1px; color: #5A3B2A; text-transform: uppercase; font-weight: 600; }
.rp-stat-val { font-family: 'Share Tech Mono', monospace; font-size: 11px; color: #C89B58; font-weight: 700; }

/* USER BAR */
#user-bar {
  height: var(--userbar-height);
  background: linear-gradient(180deg, #1C1D20 0%, #0E0E0F 100%);
  border-top: 1px solid rgba(200,155,88,.2);
  box-shadow: 0 -4px 24px rgba(0,0,0,.8), 0 -1px 0 rgba(200,155,88,.08);
  display: flex; align-items: center;
  flex-shrink: 0; position: relative; z-index: 200;
}
#user-bar-left { width: 240px; min-width: 240px; flex-shrink: 0; display: flex; align-items: center; gap: 2px; padding: 0 8px; height: 100%; border-right: 1px solid rgba(200,155,88,.08); }
#user-bar-centre { flex: 1; }
#profile-card { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 8px; border-radius: 3px; transition: background .15s; flex: 1; min-width: 0; overflow: hidden; }
#profile-card:hover { background: rgba(200,155,88,.08); }
#profile-card-avatar-wrap { position: relative; flex-shrink: 0; }
#user-bar-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #232428, #34373C); border: 1px solid rgba(200,155,88,.4); box-shadow: 0 0 10px rgba(200,155,88,.15); display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', sans-serif; font-size: 14px; color: #C89B58; overflow: hidden; }
#user-bar-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#profile-card:hover #user-bar-avatar { box-shadow: 0 0 16px rgba(200,155,88,.3); border-color: #C89B58; }
#profile-card-status { position: absolute; bottom: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: #3ba55c; border: 2px solid #0E0E0F; box-shadow: 0 0 6px rgba(59,165,92,.5); }
#profile-card-status.away    { background: #faa81a; box-shadow: 0 0 6px rgba(250,168,26,.5); }
#profile-card-status.offline { background: #34373C; box-shadow: none; }
#profile-card-status.dnd     { background: #8F1B1B; box-shadow: 0 0 6px rgba(143,27,27,.5); }
#user-bar-info { flex: 1; min-width: 0; overflow: hidden; }
#user-bar-name { font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600; color: #D2D0CB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
#user-bar-rank { font-family: 'Share Tech Mono', monospace; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; letter-spacing: 1px; }
#user-bar-actions { display: flex; gap: 2px; flex-shrink: 0; }
#user-bar-actions button { background: none; border: none; color: #5A3B2A; width: 28px; height: 28px; border-radius: 3px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; padding: 0; }
#user-bar-actions button:hover { background: rgba(200,155,88,.1); color: #C89B58; }
#user-bar-actions button#user-bar-logout-btn:hover { background: rgba(143,27,27,.1); color: #8F1B1B; }

/* ANTHEM PLAYER */
#anthem-player { width: 380px; min-width: 380px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 6px 14px; height: 100%; border-left: 1px solid rgba(200,155,88,.08); background: linear-gradient(135deg, rgba(200,155,88,.03) 0%, transparent 60%); overflow: hidden; }
#anthem-player.hidden-player { visibility: hidden; }
#anthem-controls-row { display: flex; align-items: center; gap: 10px; }
#anthem-play-btn { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #5A3B2A, #C89B58); border: none; color: #0E0E0F; font-size: 9px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .15s; box-shadow: 0 0 12px rgba(200,155,88,.3); }
#anthem-play-btn:hover { transform: scale(1.08); box-shadow: 0 0 20px rgba(200,155,88,.5); }
#anthem-info { flex: 1; min-width: 0; overflow: hidden; }
#anthem-title { font-family: 'Oswald', sans-serif; font-size: 12px; color: #D2D0CB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.3; font-weight: 500; }
#anthem-sub { font-family: 'Share Tech Mono', monospace; font-size: 7px; color: #5A3B2A; letter-spacing: 2px; display: block; margin-top: 1px; }
#anthem-repeat-btn, #anthem-mute-btn { background: none; border: none; color: #5A3B2A; font-size: 12px; cursor: pointer; transition: color .15s; padding: 3px; flex-shrink: 0; line-height: 1; border-radius: 3px; }
#anthem-repeat-btn:hover, #anthem-mute-btn:hover { color: #C89B58; }
#anthem-progress-row { display: flex; align-items: center; gap: 8px; }
#anthem-time { font-family: 'Share Tech Mono', monospace; font-size: 8px; color: #5A3B2A; flex-shrink: 0; white-space: nowrap; }
#anthem-progress-wrap { flex: 1; height: 3px; background: rgba(200,155,88,.08); border-radius: 3px; cursor: pointer; transition: height .15s; }
#anthem-progress-wrap:hover { height: 5px; }
#anthem-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #5A3B2A, #C89B58); border-radius: 3px; transition: width .1s linear; pointer-events: none; }
#anthem-vol { width: 55px; height: 3px; accent-color: #C89B58; cursor: pointer; flex-shrink: 0; }
#anthem-close-btn { background: none; border: none; color: #34373C; font-size: 10px; cursor: pointer; padding: 2px 4px; border-radius: 3px; flex-shrink: 0; transition: color .15s; }
#anthem-close-btn:hover { color: #8F1B1B; }

/* MOBILE */
#sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 99; background: rgba(0,0,0,.8); pointer-events: none; }
#sidebar-overlay.visible { display: block; pointer-events: all; }

@media (max-width: 900px) {
  #marquee-bar { display: none; }
  #app-shell { height: calc(100vh - var(--userbar-height)); }
  #sidebar { position: fixed; top: 0; left: 0; height: calc(100vh - var(--userbar-height)); z-index: 9000; transform: translateX(-100%); transition: transform .25s ease; width: var(--sidebar-width) !important; min-width: var(--sidebar-width) !important; }
  #sidebar.mobile-open { transform: translateX(0); }
  #sidebar-overlay.visible { display: block; z-index: 8999; }
  #mobile-menu-btn { display: flex !important; align-items: center; }
  #right-panel { display: none !important; }
  #anthem-player { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
  .page-content, .page-content-full, .page-content-narrow { padding: 16px; }
  .card { padding: 16px !important; }
  .notification { left: 12px !important; right: 12px !important; bottom: 16px !important; width: auto !important; max-width: none !important; }
  #koia-launcher { bottom: 16px !important; right: 16px !important; }
}

/* PAGE CONTENT */
.page-content { padding: 32px; max-width: 1100px; margin: 0 auto; }
.page-content-full { padding: 32px; }
.page-content-narrow { padding: 32px; max-width: 760px; margin: 0 auto; }

/* CHANNEL FEED */
.channel-feed { display: flex; flex-direction: column; }
.channel-message { display: flex; gap: 14px; padding: 10px 20px; border-bottom: 1px solid #232428; transition: background .15s; }
.channel-message:hover { background: rgba(200,155,88,.03); }
.channel-message.pinned { border-left: 2px solid #C89B58; background: rgba(200,155,88,.04); }
.channel-msg-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.channel-msg-body { flex: 1; min-width: 0; }
.channel-msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.channel-msg-author { font-family: 'Oswald', sans-serif; font-size: 14px; color: #D2D0CB; font-weight: 600; }
.channel-msg-date { font-family: 'Share Tech Mono', monospace; font-size: 9px; color: #5A3B2A; letter-spacing: 1px; }
.channel-msg-title { font-family: 'Oswald', sans-serif; font-size: 15px; color: #B8B8B2; margin-bottom: 6px; line-height: 1.4; font-weight: 500; }
.channel-msg-text { font-family: 'Rajdhani', sans-serif; font-size: 15px; color: #5A3B2A; line-height: 1.7; }
.channel-msg-pin-badge { font-family: 'Share Tech Mono', monospace; font-size: 8px; color: #C89B58; letter-spacing: 1px; border: 1px solid rgba(200,155,88,.3); padding: 2px 6px; }

/* ============================================================
   NAV DRAWER — raises up from bottom bar centre
   ============================================================ */

/* Trigger button in bottom bar centre */
#user-bar-centre { display: flex; align-items: center; justify-content: center; }
#nav-drawer-trigger {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #232428, #1C1D20);
  border: 1px solid rgba(200,155,88,.2);
  color: #B8B8B2; cursor: pointer;
  padding: 8px 22px; border-radius: 6px;
  transition: all .18s; height: 36px;
}
#nav-drawer-trigger:hover {
  border-color: #C89B58; color: #D2D0CB;
  box-shadow: 0 0 20px rgba(200,155,88,.15);
}
#nav-drawer-trigger.open {
  background: linear-gradient(135deg, #C89B58, #B84A32);
  border-color: #C89B58; color: #0E0E0F;
}
.ndt-icon { display: flex; flex-direction: column; gap: 3px; width: 16px; }
.ndt-line { height: 2px; background: currentColor; border-radius: 2px; transition: all .2s; display: block; }
#nav-drawer-trigger.open .ndt-line:nth-child(1) { transform: translateY(5px) rotate(45deg); }
#nav-drawer-trigger.open .ndt-line:nth-child(2) { opacity: 0; }
#nav-drawer-trigger.open .ndt-line:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.ndt-label { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 3px; }
.ndt-chevron { font-size: 8px; transition: transform .2s; }
#nav-drawer-trigger.open .ndt-chevron { transform: rotate(180deg); }

/* Overlay */
#nav-drawer-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
#nav-drawer-overlay.open { opacity: 1; pointer-events: all; }

/* Drawer panel — rises from above the bottom bar */
#nav-drawer {
  position: fixed; left: 50%; bottom: var(--userbar-height);
  transform: translateX(-50%) translateY(calc(100% + 20px));
  width: min(680px, 94vw); max-height: 56vh;
  z-index: 701;
  background: linear-gradient(180deg, #1C1D20 0%, #161210 100%);
  border: 1px solid rgba(200,155,88,.25);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -12px 48px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.22,1,.36,1), opacity .25s;
}
#nav-drawer.open {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: all;
}

/* Handle */
#nav-drawer-handle {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 0 6px; cursor: pointer; flex-shrink: 0;
}
.ndh-bar { width: 40px; height: 4px; border-radius: 4px; background: rgba(200,155,88,.35); transition: background .15s; }
#nav-drawer-handle:hover .ndh-bar { background: #C89B58; }

/* Scroll area */
#nav-drawer-scroll {
  overflow-y: auto; padding: 8px 20px 24px;
  scrollbar-width: thin; scrollbar-color: #5A3B2A transparent;
}
#nav-drawer-scroll::-webkit-scrollbar { width: 4px; }
#nav-drawer-scroll::-webkit-scrollbar-thumb { background: #5A3B2A; border-radius: 2px; }

.nav-drawer-group-label {
  font-family: 'Share Tech Mono', monospace; font-size: 8px;
  letter-spacing: 3px; color: #C89B58; text-transform: uppercase;
  margin: 16px 0 10px 4px;
}
.nav-drawer-group-label:first-child { margin-top: 4px; }

.nav-drawer-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

/* Tiles */
.nav-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 8px;
  background: #0E0E0F; border: 1px solid #232428;
  border-radius: 8px; cursor: pointer; transition: all .15s;
  min-height: 80px;
}
.nav-tile:hover {
  border-color: rgba(200,155,88,.4);
  background: #161210; transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.nav-tile.active {
  border-color: #C89B58;
  background: linear-gradient(180deg, rgba(200,155,88,.12), #0E0E0F);
}
.nt-icon { font-size: 22px; color: #8A8884; transition: color .15s; line-height: 1; }
.nav-tile:hover .nt-icon { color: #C89B58; }
.nav-tile.active .nt-icon { color: #C89B58; }
.nt-label {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 11px; letter-spacing: 1px; color: #A8A6A0;
  text-transform: uppercase; text-align: center; line-height: 1.1;
}
.nav-tile:hover .nt-label { color: #D2D0CB; }
.nav-tile.active .nt-label { color: #D2D0CB; }

/* Logout tile */
.nav-drawer-logout:hover { border-color: rgba(143,27,27,.5) !important; }
.nav-drawer-logout:hover .nt-icon { color: #8F1B1B !important; }
.nav-drawer-logout:hover .nt-label { color: #8F1B1B !important; }

/* Mobile */
@media (max-width: 900px) {
  #nav-drawer { width: 100vw; left: 0; transform: translateX(0) translateY(calc(100% + 20px)); border-radius: 12px 12px 0 0; max-height: 62vh; }
  #nav-drawer.open { transform: translateX(0) translateY(0); }
  .nav-drawer-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  #nav-drawer-trigger .ndt-label { display: none; }
}
