/* ---- 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 page fills the screen above a taskbar that runs along the bottom, on
   every screen size: the ◆ on the left (the front page, like a start
   button), the destinations in the middle, the clock and you on the right. */
.app { position: relative; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
.app > .main { z-index: 1; order: 1; }
.rail { position: relative; order: 2; }
.taskbar {
  --tb-h: 62px;
  flex-shrink: 0; display: flex; align-items: center; gap: 10px; width: 100%;
  height: calc(var(--tb-h) + env(safe-area-inset-bottom)); padding: 0 12px env(safe-area-inset-bottom);
  border-top: 1px solid var(--glass-brd); z-index: 20; background: var(--glass);
}
.rail-logo { flex-shrink: 0; border: none; background: none; padding: 4px; border-radius: 12px; transition: transform .16s var(--ease-out), background-color .15s ease; }
.rail-logo:hover { background: var(--rail-hover); }
.rail-logo:active { transform: scale(.94); }
.rail-logo .brand-mark { width: 36px; height: 36px; font-size: 19px; border-radius: 11px; }
.rail-nav { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 4px; }
.rail-item {
  position: relative; min-width: 66px; height: 50px; padding: 6px 10px 5px; border: none; background: none; border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3);
  font-size: 10.5px; font-weight: 550; letter-spacing: .01em; white-space: nowrap; transition: background .15s, color .15s;
}
.rail-item svg { width: 21px; height: 21px; flex-shrink: 0; }
.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: 2px; right: calc(50% - 22px); }
.rail-item.dragging { opacity: .4; }
.rail-item.drop-before::before { content: ""; position: absolute; left: -3px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--accent); }
.tray { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.tray-clock { display: flex; flex-direction: column; align-items: flex-end; padding: 0 6px; font-size: 11.5px; line-height: 1.3; color: var(--rail-fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tray-clock span:first-child { font-weight: 600; color: var(--rail-fg-on); font-size: 12.5px; }
.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; }

/* Narrower: the clock goes, then the logo and labels shrink to fit. */
@media (max-width: 1000px) { .tray-clock { display: none; } }
@media (max-width: 760px) {
  .taskbar { --tb-h: 58px; gap: 4px; padding: 0 4px env(safe-area-inset-bottom); }
  .rail-logo, .rail-hide { display: none; }
  .rail-nav { justify-content: space-between; gap: 0; }
  .rail-item { flex: 1; min-width: 0; padding: 6px 2px 5px; font-size: 10px; }
  .rail-item span:not(.badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .rail-item.active { background: none; box-shadow: none; }
  .hide-mobile { display: none !important; }
}
/* A phone: only the tab you're on keeps its label, so seven tabs fit. */
@media (max-width: 520px) {
  .rail-item:not(.active) span:not(.badge) { display: none; }
  .rail-item svg { width: 23px; height: 23px; }
}
@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);
}
.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);
}
.pane-title { font-family: var(--font-display); font-size: 21px; font-weight: 650; letter-spacing: -.02em; 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; }
}

/* ---- Taskbar on another side (Settings → Appearance; not on phones) ---------- */
@media (min-width: 761px) {
  .app.dock-left, .app.dock-right { flex-direction: row; }
  .app.dock-left > .rail, .app.dock-top > .rail { order: 0; }
  .app:is(.dock-left, .dock-right) .taskbar {
    --tb-w: 80px;
    flex-direction: column; width: var(--tb-w); height: 100%; padding: 12px 0 10px; gap: 8px; border-top: none;
  }
  .app:is(.dock-left, .dock-right) .rail-nav {
    flex: 1; min-height: 0; width: 100%; flex-direction: column; justify-content: flex-start; align-items: center;
    gap: 4px; overflow-y: auto; overflow-x: hidden; padding: 6px 0; scrollbar-width: none;
  }
  .app:is(.dock-left, .dock-right) .rail-nav::-webkit-scrollbar { display: none; }
  .app:is(.dock-left, .dock-right) .rail-item { flex-shrink: 0; width: 64px; min-width: 0; height: auto; padding: 8px 0 6px; }
  .app:is(.dock-left, .dock-right) .rail-item .badge { right: 8px; }
  .app:is(.dock-left, .dock-right) .tray { flex-direction: column; gap: 6px; }
  .app:is(.dock-left, .dock-right) .tray-clock { display: flex; align-items: center; padding: 0; }
  .app:is(.dock-left, .dock-right) .tray-clock span:last-child { display: none; }
}

/* A screen loading for the first time (app/shell/screens.js). */
.view-loading { display: grid; place-items: center; align-content: center; gap: 12px; min-height: 60vh; color: var(--text-2); text-align: center; }
