/* ==========================================================================
   DORAEMON HOSTING — Application Shell, Sidebar Rail, Sticky Header & Mobile Nav
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.rail-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px);
}
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: 252px; z-index: 50;
  background: var(--bg-subtle); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.rail.open { transform: translateX(0); }
@media (min-width: 1024px) {
  .rail { position: sticky; transform: translateX(0); height: 100dvh; }
  .rail-backdrop, .mobile-only-menu { display: none !important; }
}

.rail-head {
  height: 56px; padding: 0 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0;
}
.rail-head img { width: 28px; height: 28px; border-radius: 7px; }
.rail-brand { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.rail-brand span { color: var(--accent-fg); }

.rail-body { flex: 1; overflow-y: auto; padding: 10px; }
.rail-group {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3); padding: 14px 10px 5px;
}

.nav-link {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 36px; padding: 0 10px; margin-bottom: 2px; border-radius: var(--radius-xs);
  border: none; background: transparent; color: var(--text-2);
  font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-link-l { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active {
  background: var(--accent-soft); color: var(--accent-fg); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-count { font-size: 11px; font-family: var(--mono); color: var(--text-3); }

.rail-foot { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.rail-user { padding: 9px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.header {
  height: 56px; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 14px; background: rgba(9, 9, 11, 0.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .header { background: rgba(248, 250, 252, 0.9); }
.header-l { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; overflow: hidden; }
.header-r { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.crumb { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; font-size: 13px; }
.crumb-cur { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cmd-btn {
  display: none; align-items: center; gap: 8px; height: 32px; padding: 0 10px;
  border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-family: var(--font); font-size: 12px; cursor: pointer;
}
.cmd-btn:hover { border-color: var(--border-strong); color: var(--text); }
.cmd-btn kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
@media (min-width: 720px) { .cmd-btn { display: inline-flex; } }

.page { width: 100%; max-width: 1220px; margin: 0 auto; padding: 20px 16px 86px; }
@media (min-width: 1024px) { .page { padding: 26px 28px 56px; } }

.mobile-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; height: 58px;
  background: var(--bg-subtle); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
@media (min-width: 1024px) { .mobile-nav { display: none; } }
.mobile-nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; color: var(--text-3); font-family: var(--font); font-size: 10.5px; font-weight: 500; cursor: pointer;
}
.mobile-nav-btn.active { color: var(--accent-fg); font-weight: 600; }
.mobile-nav-btn.active .ic { filter: invert(53%) sepia(85%) saturate(2100%) hue-rotate(214deg) brightness(102%) contrast(98%) !important; }
