/* ---- Boot ------------------------------------------------------------------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.boot-mark { animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: .45; transform: scale(.96); } 50% { opacity: 1; transform: scale(1); } }

/* ---- Layout -----------------------------------------------------------------
   The chrome — the rail, side panels and headers — is glass over the colour
   field; the working area in the middle lets the field show through. */
.app { position: relative; display: flex; height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
.app > .main { z-index: 1; }
.rail, .tabbar { position: relative; }
.rail {
  width: var(--rail); flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 14px 0 12px; border-right: 1px solid var(--glass-brd); z-index: 20;
  background: var(--glass); backdrop-filter: blur(var(--glass-blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}
.rail-logo { margin-bottom: 14px; border: none; background: none; padding: 0; border-radius: 9px; transition: transform .28s var(--ease); }
.rail-logo:hover { transform: translateY(-2px); }
.rail-logo .brand-mark { width: 36px; height: 36px; font-size: 19px; border-radius: 11px; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; align-items: center; }
.rail-spacer { flex: 1; }
.rail-item {
  position: relative; width: 60px; padding: 8px 0 6px; border: none; background: none; border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-3);
  font-size: 10.5px; font-weight: 500; letter-spacing: .01em; transition: background .15s, color .15s;
}
.rail-item svg { width: 22px; height: 22px; }
.rail-item:hover { background: var(--hover); color: var(--text); }
.rail-item.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.rail-item.active svg { color: var(--accent); }
.rail-item .badge { position: absolute; top: 3px; right: 9px; }
.rail-item.dragging { opacity: .4; }
.rail-item.drop-before::before { content: ""; position: absolute; top: -3px; left: 10px; right: 10px; height: 2px; border-radius: 2px; background: var(--accent); }
.rail-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-me { border: none; background: none; padding: 3px; border-radius: 50%; position: relative; }
.rail-me:hover { box-shadow: 0 0 0 2px var(--border-strong); }
.rail-me.open { box-shadow: 0 0 0 2px var(--accent); }
.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.view { flex: 1; min-height: 0; display: flex; position: relative; }

.tabbar { display: none; }

@media (max-width: 760px) {
  .app { flex-direction: column-reverse; }
  .rail { display: none; }
  .tabbar {
    display: flex; flex-shrink: 0; height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--glass-brd); z-index: 20;
    background: var(--glass); backdrop-filter: blur(var(--glass-blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  }
  .tabbar .rail-item { flex: 1; width: auto; border-radius: 0; background: none; box-shadow: none; padding-top: 7px; }
  .tabbar .rail-item.active { background: none; box-shadow: none; color: var(--accent); }
  .tabbar .rail-item .badge { right: calc(50% - 20px); }
  .hide-mobile { display: none !important; }
}
@media (min-width: 761px) { .show-mobile { display: none !important; } }

/* ---- Panels ----------------------------------------------------------------- */
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-side {
  width: 300px; flex-shrink: 0; border-right: 1px solid var(--glass-brd);
  background: var(--glass); backdrop-filter: blur(var(--glass-blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}
.pane-main { flex: 1; background: transparent; }
.pane-head {
  display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.pane-main > .pane-head, .pane-main > .thread > .pane-head, .view > .pane-head {
  background: var(--glass-2); backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.pane-title { font-family: var(--font-display); font-size: 21px; font-weight: 400; letter-spacing: 0; margin: 0; flex: 1; min-width: 0; }
.pane-body { flex: 1; min-height: 0; overflow-y: auto; }
.pane-foot { border-top: 1px solid var(--border); padding: 12px 16px; flex-shrink: 0; }
@media (max-width: 760px) {
  .pane-side { width: 100%; border-right: none; }
  .split.has-detail .pane-side { display: none; }
  .split:not(.has-detail) .pane-main { display: none; }
}
