.nx-app {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

.nx-nav {
  background: var(--bg-sunken);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--s-4) 0;
  gap: var(--s-1);
}
.nx-nav__logo {
  width: 40px; height: 40px;
  border-radius: var(--r-lg);
  background: var(--paper-800);
  color: #fbfaf6;
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 22px; font-style: italic;
  margin-bottom: var(--s-4);
  text-decoration: none;
}
.nx-nav__item {
  width: 44px; height: 44px;
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  color: var(--fg-3);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nx-nav__item:hover { color: var(--fg-1); background: var(--bg-hover); }
.nx-nav__item.is-active { color: var(--accent); background: var(--accent-soft); }
.nx-nav__item.is-active::before {
  content: '';
  position: absolute;
  left: -14px; top: 10px; bottom: 10px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nx-nav__spacer { flex: 1; }
.nx-nav__avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--indigo-400), var(--indigo-700));
  color: white;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}

.nx-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.nx-header {
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-5);
  align-items: center;
}
.nx-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-xs);
  color: var(--fg-3);
}
.nx-breadcrumb svg { width: 12px; height: 12px; }
.nx-breadcrumb__here { color: var(--fg-1); font-weight: 500; }
.nx-title {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--fg-1);
  font-weight: 400;
  margin: 2px 0 0;
}
.nx-title em { font-style: italic; color: var(--accent); }

.nx-header__actions { display: flex; gap: var(--s-2); align-items: center; }

.nx-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.nx-panel__head {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
}
.nx-panel__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--fg-1);
  font-weight: 400;
  font-style: italic;
  margin: 0;
}
.nx-panel__body { padding: var(--s-4) var(--s-5); }

.nx-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: inline-grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-2);
  cursor: pointer;
}
.nx-icon-btn:hover { background: var(--bg-hover); color: var(--fg-1); }


@media (max-width: 1024px) {
  .nx-app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .nx-nav { display: none !important; }

  .nx-header {
    padding: var(--s-4) var(--s-5);
    grid-template-columns: 1fr;
    gap: var(--s-3);
  }
  .nx-header__actions { justify-self: start; flex-wrap: wrap; }
  .nx-title { font-size: 28px !important; }
}

@media (max-width: 640px) {
  .nx-header {
    padding: var(--s-3) var(--s-4);
    gap: var(--s-2);
  }
  .nx-title { font-size: 22px !important; }
  .nx-breadcrumb { font-size: 11px; }
  .nx-btn { min-height: 40px; }
  .nx-btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
}

@media (max-width: 380px) {
  .nx-header { padding: var(--s-2) var(--s-3); }
  .nx-title { font-size: 20px !important; }
}

@media (max-width: 1023px) {
  .nx-mobile-nav { display: flex !important; }
}

.nx-mobile-nav__item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.nx-mobile-nav__item.is-active { color: var(--accent) !important; }
.nx-mobile-nav__item.is-active svg { stroke-width: 2; }

@media (max-width: 380px) {
  .nx-mobile-nav__item { padding: 8px 2px !important; font-size: 9px !important; }
  .nx-mobile-nav__item .nx-icon { width: 20px; height: 20px; }
}

.nx-more-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 25, 22, 0.55);
  z-index: 95;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.nx-more-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 96;
  background: var(--bg);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: 0 -16px 50px rgba(0,0,0,0.25);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nx-more-sheet__handle {
  width: 44px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.nx-more-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.nx-more-sheet__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-style: italic;
  color: var(--fg-1);
  font-weight: 400;
}
.nx-more-sheet__x {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--fg-2);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.nx-more-sheet__x:hover { background: var(--bg-hover); color: var(--fg-1); }
.nx-more-sheet__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-3) var(--s-3) var(--s-5);
  display: grid;
  gap: var(--s-4);
}
.nx-more-group {
  display: grid;
  gap: 4px;
}
.nx-more-group__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 0 var(--s-3) 4px;
}
.nx-more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.nx-more-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--s-3) 6px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  color: var(--fg-1);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  min-height: 80px;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.nx-more-tile:hover, .nx-more-tile:active { background: var(--bg-hover); border-color: var(--border); }
.nx-more-tile.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-soft-fg);
}
.nx-more-tile svg { width: 22px; height: 22px; flex-shrink: 0; }
.nx-more-tile.is-accent { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

@media (max-width: 380px) {
  .nx-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-more-tile { min-height: 72px; font-size: 11px; }
}
