/* App shell */
.app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none; overflow-y: auto; overscroll-behavior: contain; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 14px;
  background: radial-gradient(circle at 0 0, #5a222d 0, transparent 38%), linear-gradient(165deg, var(--side-bg-2) 0%, var(--side-bg) 64%, var(--side-bg-2) 100%); color: var(--side-ink); border-right: 1px solid var(--side-line); scrollbar-width: thin; scrollbar-color: #5a2c35 transparent; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 10px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #ffb48d, #f25f5c); color: #4a1621; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); flex: none; }
.brand-mark .i { width: 24px; height: 24px; fill: #ffe5d9; stroke: #4a1621; stroke-width: 1.6; }
.brand-text { font: 800 19px/1 var(--font-head); letter-spacing: -.06em; color: #fff; }
.brand-text b { color: #ffb4a3; font-weight: 800; }
.brand-text small { display: block; margin-top: 6px; font: 700 8.5px/1 var(--font); letter-spacing: .14em; color: var(--side-ink-2); text-transform: uppercase; }
.side-nav { display: grid; gap: 12px; }
.side-section { display: grid; gap: 2px; }
.side-label { font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--side-ink-2); padding: 4px 12px 5px; }
.side-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px; color: var(--side-ink); font-weight: 600; font-size: 13.5px; transition: background .2s, color .2s; }
.side-link .i { width: 18px; height: 18px; opacity: .85; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.active { background: linear-gradient(105deg, #ffb18d, #ffe1c7); color: #3e1720; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.side-link.active .i { opacity: 1; }
.side-link .count { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 7px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #ffd9cb; }
.side-link.active .count { background: rgba(62, 23, 32, .12); color: #3e1720; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #58d68d; box-shadow: 0 0 0 0 rgba(88, 214, 141, .7); animation: pulse 1.6s infinite; margin-left: auto; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(88, 214, 141, .6); } 70% { box-shadow: 0 0 0 8px rgba(88, 214, 141, 0); } 100% { box-shadow: 0 0 0 0 rgba(88, 214, 141, 0); } }
.level-card { margin-top: auto; display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: linear-gradient(150deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .1); color: var(--side-ink); transition: transform .2s; }
.level-card:hover { transform: translateY(-2px); }
.level-top { display: flex; gap: 11px; align-items: center; }
.level-top b { color: #fff; font-family: var(--font-head); font-size: 14px; }
.level-top small { display: block; color: var(--side-ink-2); font-size: 10.5px; margin-top: 2px; }
.level-badge { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #ffcf6e, #ff8a5c); color: #4a1621; font: 800 17px/1 var(--font-head); box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.xp-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.xp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff8a5c, #ffcf6e); }
.level-foot { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; color: #ffc9ae; }
.level-foot .i { width: 15px; height: 15px; color: #ff9b6a; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 clamp(16px, 3vw, 40px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); min-width: 0; }
.crumbs .i { width: 13px; height: 13px; }
.crumbs b { color: var(--ink); letter-spacing: -.01em; text-transform: none; font-size: 14px; font-family: var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger { display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 10px 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-size: 13px; min-width: 250px; transition: border-color .2s, box-shadow .2s; }
.search-trigger:hover { border-color: var(--brand-3); box-shadow: var(--shadow-sm); }
.search-trigger span { flex: 1; text-align: left; }
.session-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 99px; background: linear-gradient(120deg, #1f7a52, #2f9e6e); color: #fff; font-size: 12.5px; box-shadow: 0 8px 20px rgba(47, 158, 110, .3); max-width: 330px; }
.session-pill b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.session-pill small { font-variant-numeric: tabular-nums; opacity: .9; }
.session-pill em { font-style: normal; font-weight: 800; background: rgba(255, 255, 255, .18); padding: 2px 7px; border-radius: 99px; font-size: 11px; }
.session-pill .pulse { width: 8px; height: 8px; border-radius: 50%; background: #b7ffd8; animation: pulse 1.6s infinite; }
.page { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 22px clamp(16px, 3vw, 40px) 60px; outline: none; }
.app-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px clamp(16px, 3vw, 40px) 26px; color: var(--ink-3); font-size: 12px; border-top: 1px solid var(--line); }
.app-foot a { color: var(--brand); font-weight: 700; }
.boot { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-3); }
.bottom-nav { display: none; }
.drawer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 6, 10, .5); opacity: 0; transition: opacity .25s; }
.drawer-panel { position: absolute; inset: 0 auto 0 0; width: min(300px, 86vw); overflow-y: auto; transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); padding: 20px 14px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(165deg, var(--side-bg-2), var(--side-bg)); color: var(--side-ink); }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }

/* Page scaffolding */
.page-head { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 190px; padding: clamp(22px, 3vw, 36px) clamp(22px, 3vw, 40px); margin-bottom: 22px; border-radius: 24px; background: var(--hero); color: var(--hero-ink); box-shadow: 0 22px 46px rgba(106, 40, 48, .22); }
.page-head::before { content: ''; position: absolute; z-index: -1; right: -120px; top: -180px; width: 520px; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 0 0 54px rgba(255, 255, 255, .04), 0 0 0 110px rgba(255, 255, 255, .035), 0 0 0 170px rgba(255, 255, 255, .03); }
.page-head h1 { color: #fff; margin: 10px 0 10px; }
.page-head h1 em { font-style: normal; color: #ffb193; }
.page-head p { color: var(--hero-ink-2); max-width: 640px; font-size: 14px; }
.page-head .kicker { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #ffcab4; }
.page-head .kicker span { width: 24px; height: 1.5px; background: #ffc5a8; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.page-head-actions .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); }
.page-head-actions .btn.ghost:hover { background: rgba(255, 255, 255, .16); }
.page-head-art { flex: none; }
.page-head.slim { min-height: 0; padding-top: 22px; padding-bottom: 22px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; }
.section-head .kicker2, .kicker2 { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--brand); margin-bottom: 5px; }
.cols { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); }
@media (max-width: 1200px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-main { grid-template-columns: 1fr; } }
@media (max-width: 980px) { .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* Responsive shell */
@media (max-width: 1100px) {
  .search-trigger { min-width: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 8px; height: 58px; }
  .crumbs > span, .crumbs > .i { display: none; }
  .session-pill b, .session-pill small { display: none; }
  .page { padding: 16px 16px 96px; }
  .app-foot { padding-bottom: 96px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40; padding: 6px; border-radius: 20px; background: color-mix(in srgb, var(--side-bg) 94%, transparent); backdrop-filter: blur(12px); box-shadow: var(--shadow-lg); }
  .bottom-nav a, .bottom-nav button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 7px 2px 5px; border: 0; background: none; border-radius: 14px; color: var(--side-ink-2); font-size: 10.5px; font-weight: 700; }
  .bottom-nav .i { width: 20px; height: 20px; }
  .bottom-nav a.active { color: #3e1720; background: linear-gradient(105deg, #ffb18d, #ffe1c7); }
  .bottom-nav .live-dot { position: absolute; top: 6px; right: 26%; margin: 0; }
  .page-head { border-radius: 20px; min-height: 0; flex-direction: column; align-items: flex-start; }
  .page-head-art { display: none; }
  .topbar [data-act="shortcuts"] { display: none; }
}
